Example #1
0
        for ($i = 0; $i < count($node_counter); $i++) {
            $givenPotential->dependencies[$i] = $node_counter[$i]['curState'];
        }
        for ($i = count($node_counter) - 1; $i >= 0; $i--) {
            $node_counter[$i]['curState']++;
            if ($node_counter[$i]['curState'] >= $node_counter[$i]['numStates']) {
                $node_counter[$i]['curState'] = 0;
            } else {
                break;
            }
        }
        $node->addPotentials($givenPotential);
    }
}
file_put_contents($argv[2], $nodes->getCode());
file_put_contents($argv[3], $nodes->getEnums());
echo "net2dlib is done!\n";
class GivenPotential
{
    public $values = array();
    public $dependencies = array();
}
class Node
{
    public $name = '';
    public $type = '';
    public $states = array();
    public $influences = array();
    public $potentials = array();
    function __construct($type, $name)
    {