4.1 Principle of Operation

A schematic diagram of multinode model implementation is in Figure 4.1.

An environment state identification engine, instruction emitting engine, and instruction execution environment are main model components taking part in model execution.

The environment state identification engine is a small or large actor keeping an adaptive state model of an environment and identifying node states according to the model. This identification is a bidirectional process: the current state of a node depends on the state of the environment and needs identification; conversely, the node acts on the environment, and, therefore, the state of the environment depends on an identified node state. For a single-node model, its node corresponds to the entire environment. For a multinode model, a node corresponds to part of the environment.

Along with the adaptive state model, the environment state identification engine keeps the identifier of a currently executed node, the index of its previous state, the identifier of the last instruction or the last instruction sequence emitted by the instruction emitting engine, the outcome of that instruction or instruction sequence, an optional array of identifiers of look-ahead signals (see Setting Look-Ahead Signals), and, as an actor, it keeps current values of spur and continuous time. For a single-node model, the identifier of a currently executed node is always equal to 0. The structure of tuples encoding action choice states of the environment state identification engine is in Figure 4.2.

The environment state identification engine identifies the current state of a node based on its identifier, the previous state of the node, the identifier of the last instruction or the last instruction sequence emitted, the outcome of that instruction or instruction sequence, and optional look-ahead signals. The environment state identification engine sends the identifier of a currently executed node and the index of its identified state to the instruction emitting engine. The latter engine is a small or large actor keeping an adaptive model of emitting various assembler instructions and their sequences in various node states. As an actor, the instruction emitting engine keeps current values of spur and continuous time, and they can be different from current values of spur and continuous time for the environment state identification engine.

The structure of tuples encoding action choice states of the instruction emitting engine is in Figure 4.3. The instruction emitting engine selects an output signal encoding an assembler instruction or a sequence of assembler instructions. The identifier of a currently executed node and a current node state received from the environment state identification engine take part in selecting the output signal.

The instruction emitting engine sends a selected assembler instruction or a selected sequence of assembler instructions to the instruction execution environment for performing effective work and to the environment state identification engine for identifying the next node state. That instruction execution environment represents everything else in the multinode model, interacts with application logic or incorporates it, and is aware of all parameters of the environment state identification engine and instruction emitting engine. An assembler instruction or a sequence of assembler instructions returns an instruction outcome after execution. The instruction execution environment sends the outcome to the environment state identification engine for identifying the next node state.

The instruction execution environment keeps a node call stack for the execution of nodes to be similar to the execution of program subroutines (functions or procedures) calling each other and returning control to caller subroutines. An executed assembler instruction can push the identifier of a currently executed node and the index of its current state to the node call stack and transfer control to another node with resetting the current node state to the initial node state corresponding to the beginning of execution of a subroutine. The assembler instruction can also return control to a previously executed node by popping the identifier of the node and the index of its current state from the stack.

An assembler instruction can change look-ahead signals taking part in identifying the next node state and increment current values of spur and continuous time tracked by the environment state identification engine and instruction emitting engine.

multinode model implementation

Figure 4.1: multinode model implementation

action choice state of environment state identification engine

Figure 4.2: action choice state of environment state identification engine

action choice state of instruction emitting engine

Figure 4.3: action choice state of instruction emitting engine

A helpful feature of a multinode model is ability to convert internal data stored in its environment state identification engine and instruction emitting engine to a representation in the form of an assembler program (see Assembler Programs). One can think about this feature as automatic synthesis of an assembler program solving an assigned task.

An important point the developer should realize is that automatic program synthesis may work only if there exists a steady state model solving an assigned task. Steady state model is a model where states have predictable input from an environment.

Below there is a list of concepts for enabling the automatic synthesis of assembler programs.

Instruction meta-class

Represents an instruction name without taking into account optional instruction parameters following the instruction name after a whitespace character. The name of an instruction meta-class is the name of an instruction without including instruction parameters. Example:

move

This instruction meta-class might represent an instruction that moves an agent in an environment one step in a specific direction. The name of the instruction meta-class does not include a movement direction.

Individual instruction class

Represents an instruction name optionally followed by instruction parameters. Distinct strings, where every string consists of an instruction name and instruction parameters in canonical form (see Setting Text Instruction Parameters), identify distinct individual instruction classes. Example:

move north

This instruction class might represent an instruction that moves an agent in the environment one step in the north direction.

Instruction class sequence

A sequence of individual instruction classes. Example:

move west
move west
move south

This instruction class sequence might move an agent two steps in the west direction and then one step in the south direction.

Instruction outcome

An individual instruction class has a specific number of instruction outcomes. The outcome of a sequence of instructions is the outcome of the last instruction in the sequence.

The environment state identification engine uses the outcome of an emitted instruction or an emitted sequence of instructions to identify the next node state. The instruction emitting engine uses the next node state to select the next instruction or the next sequence of instructions.

For example, the instruction ‘move north’ as well as other movement instructions could return a bitmask of four bits (i.e. an integer number in the range 0 to 15) after performing a move. A bit of the bitmask equal to 0 could indicate that there was an obstacle in a corresponding direction, thus giving a piece of information to the agent about the configuration of an environment. It might also be useful to return special outcome 16 if there was an obstacle in a direction specified by an emitted instruction, and the obstacle disallowed the agent to move.

Instruction class set

Represents a set containing individual instruction classes and sequences of instruction classes along with their properties and is a class for nodes. For example, the instruction class set ‘walker’ intended for investigating an environment might contain the individual instruction classes

move north
move east
move south
move west

the instruction class sequence

move west
move west
move south

and the instruction class sequence

move north
move east

A node belonging to this node class might represent an agent investigating an environment.

Instruction instance

An instance of an instruction class in an assembler program. For example, in the assembler program fragment

        move north
        joe  14, return_back
        move north
        ...
return_back:
        move south
        ...

there are two instances of ‘move north’ instruction class.