Saturday, August 22, 2015

Perkun variables.

Perkun (http://sourceforge.net/projects/perkun/) allows three kinds of variables:
  • input variables
  • hidden variables
  • output variables
On the picture above the time axis is shown. We can see two sets of the input and hidden variables (NOW and LATER) and one set of the output variables. The yellow arrow denotes an agent (Perkun program) which chooses the values of the output variables given the current values of the input variables (and its memory). Note that the world is an automaton whose state LATER depends both on its state NOW and the agent's decision (output variables values).

The hidden variables are essential for the machine learning. They represent the state variables of the world that are not directly visible to the agent. Yet they do affect the state of the world.

Let us forget for now the hidden variables though, and introduce a simple Perkun code with one input variable and one output variable:

 
values
{
        value false, true;
        value move, do_nothing;
}

variables
{
        input variable what_I_can_see:{false, true};
        output variable action:{move, do_nothing};
}


payoff {}
model {}

As you can see the variables section contains now two variables:
  • what_I_can_see
  • action
Unlike many other programming languages Perkun does not have the concept of a variable type. Instead each variable declaration is followed by a colon and a list of possible values in curly brackets, separated by comas. For example what_I_can_see may have value false or true.

Try using the command "cout << variables << eol;":


values
{
        value false, true;
        value move, do_nothing;
}

variables
{
        input variable what_I_can_see:{false, true};
        output variable action:{move, do_nothing};
}


payoff {}
model {}
cout << variables << eol;

When you put the above text in a file and call Perkun it will respond:
# variables
input variable what_I_can_see:{false,true};
output variable action:{move,do_nothing};



By the way you have learned another command. You know currently:
  • cout << values << eol;
  • cout << variables << eol;




No comments:

Post a Comment