1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <html>
- <head>
- <title>Consensus Operator</title>
- <script type="text/javascript" src="CertainTrust.js"></script>
- <script type="text/javascript" src="certainTrustHTI.js"></script>
- <link rel="stylesheet" type="text/css" href="certainTrustHTI.css"/>
- <script type="text/javascript" src="certainTrustTViz.js"></script>
- <link rel="stylesheet" type="text/css" href="certainTrustTViz.css" />
- </head>
- <body>
- Operand 1 : <br>
- <label for="">t1: </label><input type="textbox" name="t1"></input>
- <label for="">c1: </label><input type="textbox" name="c1"></input>
- <label for="">f1: </label><input type="textbox" name="f1"></input><br><br>
- Operand 2 : <br>
- <label for="">t2: </label><input type="textbox" name="t2"></input>
- <label for="">c2: </label><input type="textbox" name="c2"></input>
- <label for="">f2: </label><input type="textbox" name="f2"></input><br><br>
-
- <button onClick="calculateConsensus()">Execute</button><br><br><br>
-
- <div id = "obj1">
- </div>
- <div id = "obj2">
- </div>
- <div id = "con">
- </div>
- <div id = "dis">
- </div>
-
- <script type="text/javascript">
- function calculateConsensus() {
- var t1 = parseFloat(document.getElementsByName('t1')[0].value);
- var c1 = parseFloat(document.getElementsByName('c1')[0].value);
- var f1 = parseFloat(document.getElementsByName('f1')[0].value);
-
- var t2 = parseFloat(document.getElementsByName('t2')[0].value);
- var c2 = parseFloat(document.getElementsByName('c2')[0].value);
- var f2 = parseFloat(document.getElementsByName('f2')[0].value);
-
- var ctObject1 = new CertainTrust(t1,c1,f1,50);
- var ctObject2 = new CertainTrust(t2,c2,f2,50);
-
- var ctResult1 = ctObject1.CONSENSUS(ctObject2);
- var ctResult2 = ctObject1.DISCOUNTING(ctObject2);
-
- document.getElementById("obj1").innerHTML="Operand 1 : ";
- var HTI1 = new CertainTrustHTI(ctObject1,{domParent: obj1, canvas:{height: 100, width: 125}, readonly:true});
- document.getElementById("obj2").innerHTML="Operand 2 : ";
- var HTI2 = new CertainTrustHTI(ctObject2,{domParent: obj2, canvas:{height: 100, width: 125}, readonly:true});
- document.getElementById("con").innerHTML="Consensus : ";
- var HTI3 = new CertainTrustHTI(ctResult1,{domParent: con, canvas:{height: 100, width: 125}, readonly:true});
- document.getElementById("dis").innerHTML="Discounting : ";
- var HTI4 = new CertainTrustHTI(ctResult2,{domParent: dis, canvas:{height: 100, width: 125}, readonly:true});
-
- }
- </script>
- </body>
- </html>
|