Browse Source

Update for C value not to be 1

Debashis Chandra Ray 4 years ago
parent
commit
e73ff69e64

+ 7 - 0
JavaScript/JavaScript_Examples/CertainTrust.js

@@ -269,6 +269,9 @@ CertainTrust.prototype._singleOR = function(arg) {
 	var c2 = arg.getC();
 	var t2 = arg.getT();
 	var f2 = arg.getF();
+	
+	
+
 
 	var resT = 0.5, resF = 0.5, resC = 0;
 
@@ -336,6 +339,7 @@ CertainTrust.prototype._singleAND = function(arg){
 	var c2 = arg.getC();
 	var f2 = arg.getF();
 	var t2 = arg.getT();
+	
 
 	var resC = 0, resT = 0.5, resF = 0.5;
 
@@ -434,6 +438,9 @@ CertainTrust.prototype._internalFusion = function(args, weights, doc) {
 			allOne = false;
 			i = arrLength;
 		}
+	
+
+	
 	for (i = 0; i < arrLength; ++i)
 		if (args[i].getC() !== 0) {
 			allZero = false;

+ 16 - 0
JavaScript/JavaScript_Examples/certainTrustHTI.js

@@ -375,6 +375,13 @@ CertainTrustHTI.prototype._onClick = function(e, clkcanvas) {
 	var cy = ctBounding.top;
 	var newT = Math.max(0, Math.min(1, (x - cx) / clkcanvas.width));
 	var newC = Math.max(0, Math.min(1, 1 - ((y - cy) / clkcanvas.height)));
+	
+	//--------- modified by Debashis ----------------------
+		
+		if(newC == 1){
+			newC = 0.999;
+		}
+	
 	cte.certainTrust.setTC(newT, newC);
 };
 
@@ -405,6 +412,15 @@ CertainTrustHTI.prototype._updateInput = function(id) {
 	} else { // if ( == '-c' || == '-t')
 		var newT = this._normalizeInput(document.getElementById(cid + '-t').value);
 		var newC = this._normalizeInput(document.getElementById(cid + '-c').value);
+		
+		//--------- modified by Debashis ----------------------
+		
+		if(newC == 1){
+			newC = 0.999;
+		}
+		
+		//-----------------------------------------------------
+		
 		this.certainTrust.setTC(
 			(isNaN(newT)) ? this.certainTrust.getT() : newT,
 			(isNaN(newC)) ? this.certainTrust.getC() : newC

+ 7 - 0
JavaScript/JavaScript_SDK/CertainTrust.js

@@ -269,6 +269,9 @@ CertainTrust.prototype._singleOR = function(arg) {
 	var c2 = arg.getC();
 	var t2 = arg.getT();
 	var f2 = arg.getF();
+	
+	
+
 
 	var resT = 0.5, resF = 0.5, resC = 0;
 
@@ -336,6 +339,7 @@ CertainTrust.prototype._singleAND = function(arg){
 	var c2 = arg.getC();
 	var f2 = arg.getF();
 	var t2 = arg.getT();
+	
 
 	var resC = 0, resT = 0.5, resF = 0.5;
 
@@ -434,6 +438,9 @@ CertainTrust.prototype._internalFusion = function(args, weights, doc) {
 			allOne = false;
 			i = arrLength;
 		}
+	
+
+	
 	for (i = 0; i < arrLength; ++i)
 		if (args[i].getC() !== 0) {
 			allZero = false;

+ 16 - 0
JavaScript/JavaScript_SDK/certainTrustHTI.js

@@ -375,6 +375,13 @@ CertainTrustHTI.prototype._onClick = function(e, clkcanvas) {
 	var cy = ctBounding.top;
 	var newT = Math.max(0, Math.min(1, (x - cx) / clkcanvas.width));
 	var newC = Math.max(0, Math.min(1, 1 - ((y - cy) / clkcanvas.height)));
+	
+	//--------- modified by Debashis ----------------------
+		
+		if(newC == 1){
+			newC = 0.999;
+		}
+	
 	cte.certainTrust.setTC(newT, newC);
 };
 
@@ -405,6 +412,15 @@ CertainTrustHTI.prototype._updateInput = function(id) {
 	} else { // if ( == '-c' || == '-t')
 		var newT = this._normalizeInput(document.getElementById(cid + '-t').value);
 		var newC = this._normalizeInput(document.getElementById(cid + '-c').value);
+		
+		//--------- modified by Debashis ----------------------
+		
+		if(newC == 1){
+			newC = 0.999;
+		}
+		
+		//-----------------------------------------------------
+		
 		this.certainTrust.setTC(
 			(isNaN(newT)) ? this.certainTrust.getT() : newT,
 			(isNaN(newC)) ? this.certainTrust.getC() : newC