This tutorial focuses mainly on exploring State Variable Rules (SVRules). Quoting from the genetics kit help file:
State Variable Rules (or SVRules) are genetically defined functions that are used throughout a brain lobe structure to control several aspects of synaptic behaviour, as well as an SVRule to compute a neurone€s state.
Tutorial One demonstrated how the leakage rate was applied to the State of a cell to move it towards its rest state. A leakage rate is a function that is applied to state to get the output of the cell. An SVRule is the same. It is a function that is applied to the state of a cell to calculate the output (Here I'm talking about the 'Neurone State Rule' in the 'Cell Body' tab of the brain lobe). Both leakage rate and SVRule act on the state to produce the output. In the following examples we will set the leakage rate to the largest possible value (52 years). This will effectively disable the leakage and only apply the SVRule to the state. This will allow us to view the exact effects of various SVRules.
An SVRule is like a miniature program written in a special programming language. This programming language has a number of 'opcodes' or operations that it can perform on various pieces of data. The result of all the opcodes is assigned to be the output of the cell. Only eight individual opcodes are allowed in an SVRule making them very small and fast to execute - the SVRule for every cell in the brain must execute approximately 10 times per second!
The following table lists the opcodes available for writing SVRules. The descriptions after each opcode are what I think they do. I obtained this data through experimentation so if you have other information relating to what an opcode does or means please let me know. Following the description in the example column there may be a link to a page that goes through an example using BrainCellMonitor to display the effects of that particular opcode.
Updated 10/04/1999: A full table of the latest state variable rule information for all creatures versions is now available. The table below may be out of date but is valid for this tutorial.
Opcode | Description |
---|---|
end | Marks the end of an SVRule. Any opcodes appearing after this marker are ignored. |
0 | The integer number zero. Can be used for calculations. |
1 | The integer number one. Can be used for calculations. For example, adding or subtracting one from the current state. |
64 | The integer number sixty-four. Can be used for calculations. For example, adding or subtracting sixty-four from the current state. |
255 | The integer number 255. Can be used for calculations. For example, adding or subtracting 255 from the current state. |
chem 0 | Represents the current amount of chemical 0 in the brain lobe. This chemical can be added to a lobe through a genetic receptor. |
chem 1 | Represents the current amount of chemical 1 in the brain lobe. This chemical can be added to a lobe through a genetic receptor. |
chem 2 | Represents the current amount of chemical 2 in the brain lobe. This chemical can be added to a lobe through a genetic receptor. |
chem 3 | Represents the current amount of chemical 3 in the brain lobe. This chemical can be added to a lobe through a genetic receptor. |
state | Represents the current value of the state of the cell. |
output | Represents the current output value of the cell. |
thres | The value of 'Nominal Threshold' defined in 'Cell Body Dynamics'. |
type 0 | The sum of type 0 dendrites. |
type 1 | The sum of type 1 dendrites. |
anded 0 | If all type 0 dendrites are firing then this will be the value of the sum of these dendrites. If any of the type 0 dendrites are not firing then this value will be 0. |
anded 1 | If all type 1 dendrites are firing then this will be the value of the sum of these dendrites. If any of the type 1 dendrites are not firing then this value will be 0. |
input | To be defined. |
conduct | To be defined. |
suscept | Current susceptibility to reinforcement - but which one? Type 0 or Type 1 dendrites? The cell itself? Needs investigating. |
STW | STW means Short Term Weight but which one? Type 0 or Type 1 dendrites? |
LTW | LTW means Long Term Weight but which one? Type 0 or Type 1 dendrites? LTW acts as a rest state for STW. STW and LTW reduce towards each other with LTW moving slower than STW. |
Strength | Current value of dendrite strength - I assume it is the sum of all the strengths of all the dendrites? Or is it type 0 or type 1? |
TRUE | If the previous opcode evaluates to TRUE (ie. not zero) then execute the remaining opcodes otherwise the value of state is zero and the SVRule completes. This is what appears to happen in example 4. |
PLUS | Adds the value of the following option to the value of the previous opcode. |
MINUS | Subtracts the value of the following opcode from the value of the previous opcode. For example 'state:MINUS:1' will subtract '1' from the current value of 'state'. |
TIMES | Takes the left hand opcode multiplied by the right hand opcode and divides this by 256. The result of this calculation is the value of this opcode. For example: '64:TIMES:thres' where 'thres' is 32 will be 32*64/256=8. |
INCR | Returns the value of the previous opcode incremented by one. For example 'state:INCR' will add one to the current value of state. |
DECR | Returns the value of the previous opcode decremented by one. For example 'state:DECR' will subtract one from the current value of state. |
unused | To be defined. |
unused | To be defined. |
ERROR | To be defined. |
To demonstrate the effects of SVRules we will modify the example1 norn from Tutorial 1. This norn will be changed to make sure the leakage rate does not affect the cell output so we can view the effects of the SVRules. Load the norn from example1 in Tutorial 1 into the genetics kit and modify the 'Cell Body' tab of the additional brain lobe that was created to have the following settings:
Nominal Threshold | 0 - slider all the way to the left |
Leakage Rate | 248 - 52 Years - Slider all the way to the left |
Rest State | 0 - slider all the way to the left |
Input gain lo-hi | 255 - slider all the way to the right |
A .gen file is available in base.zip to use as a starting point if you wish.
The .gen file and a norn exported with this genome is available in example1.zip. This should enable you to try some of this example out even if you don't have the genetics kit.
inst,trig
9 0 255,endm
inst,trig
9 0 0,endm
Note that the 'DECR' opcode does the opposite of INCR. The SVRule 'state:DECR' is functionally the same as 'state:MINUS:1'.
This example lists the SVRules that were set and the results that were observed. By following the previous examples you should be able to work out how to duplicate the results.
SVRule | Result |
---|---|
thres:TRUE:64 | The state is set to 64 only if the value of 'Nominal Threshold' is not zero. If the threshold is zero then the state will be zero. |
64:TIMES:thres | With 'Nominal Threshold' set to 1 we get a result of '0'. With 'Nominal Threshold' set to 64 we get a result of '16'. With 'Nominal Threshold' set to 32 we get a result of '8'. The result of using TIMES appears to be left-hand-opcode multiplied by right-hand-opcode divided by 256. |
The following opcodes still need to be worked out in future examples (they'll be displayed in the table above when done):
Opcode | Description |
---|---|
input | To be defined. |
conduct | To be defined. |
suscept | Current susceptibility to reinforcement - but which one? Type 0 or Type 1 dendrites? The cell itself? Needs investigating. |
STW | STW means Short Term Weight but which one? Type 0 or Type 1 dendrites? |
LTW | LTW means Long Term Weight but which one? Type 0 or Type 1 dendrites? LTW acts as a rest state for STW. STW and LTW reduce towards each other with LTW moving slower than STW. |
Strength | Current value of dendrite strength - I assume it is the sum of all the strengths of all the dendrites? Or is it type 0 or type 1? |