Home |
Calculator |
Levels |
CQS |
Rating |
FAQ |
Papers |
**Code** |
CR

##
*ConsScale* Source Code

All *ConsScale* related code is available at Conscious-Robots.com Machine Consciousness download section.

The *ConsScale* source code package is a zip file that contains both these HTML pages

with the information about the scale and also the Javascript code of the CQS calculator.

Of course, you don't need to download the code to use the scale, you can just use the

Online *ConsScale* Calculator, which is based on this very same code.

The *consscale.js* file includes the Javascript code to calculate the *ConsScale* Quantitative Score:

/*
* Calculates the value of the CQS based on current value of CLS
*/
function CalculateCQS()
{
return (Math.exp(Math.pow(CLS,5)/K)+a)/10;
}

The value of CQS is based on the CLS (Cumulative Level Score), which is calculated as follows:

/*
* Calculates the value of CLS based on current values of Li.
*/
function CalculateCLS()
{
var sum_cls = 0.0;
var sum_element = 0.0;
// Main Summation (starts at level 2)
for (i=2;i [minor_than] TopLevel+1;i++)
{
sum_element = Li[i] / (i-1);
sum_cls = sum_cls + (sum_element*sum_element);
}
return sum_cls;
}

And initially, the Li values are calculated using this function:

/*
* Calculates the value of Li for the indicated level
* using current state of ConsScale CS matrix
*/
function CalculateLi(level)
{
// Count number of CS fulfilled in level i
var ncsf = 0;
for (i=0;i [minor_than] Ji[level]+1;i++)
{
if (ConsScaleMatrix[level][i] == 1)
{
ncsf++;
}
}
// Only if ncsf is greater than 0 the Li equation has to be computed
if ( ncsf == 0 )
{
return 0.0;
}
else
{
// Upper part of the Li equation
var upper_eq = ncsf+(J-Ji[level]);
upper_eq = upper_eq*upper_eq*upper_eq;
return upper_eq / 1000;
}
}

This work is licenced under a Creative Commons Licence.