NetLogo User Community Models(back to the NetLogo User Community Models)

Download If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled because this model uses extensions.) 
WHAT IS IT?
This is a 1 dimensional cellular automata explorer
HOW IT WORKS
Patches get new states from the states of their 2 closest neighbors and the state of themself. These values are composed into a single value by a rule.
Rules can be: 1)mutated 2)changed automatically and manually 3)gotten from examples
Rules are feedforward neural networks (http://en.wikipedia.org/wiki/Feedforward_neural_network) containing 1  3 hidden layers with each layer having 1  20 neurons + output layer consisting of one neuron and input layer consisting of 3 neurons.
Activation function: y = x / (0.1 + abs x)
Patch states, neuron output values and connection weight values are all in range [1,1]
Each neuron operates as follows: 1)sum of all previous layer inputs times the incoming connection weight is calculated 2)previous value (1) is sent trough the activation function 3)previous value (2) is compared to the threshold value of neuron. if (2) > threshold value of neuron and output is produced and it has the value (2), otherwise the output value will be 0
The only special case are the neurons in the feedforward neural network input layer that only produce neuron output.
HOW TO USE IT
BASICS:
Press go to start. Perss newrules for new rules. Switch world by changing the world slider. Mutate the most interesting world.
IN DEPTH:
go: start the program
showline: Visualizes current row of the world with a line. Doing so may give valuable information about the nature of the observed rule.
darken: no color updates, easier to see line
refreshcolor: refresh the color values of the whole screen
newrules: Makes completely new rules
randomvalues: random patch values
randomone: random patch value for one patch
one? if its on then randomone will be used when switching/mutating worlds, otherwise randomvalues determine the states of the world
mutaterules: mutate the rules based on current rule. if the rule stays the same it is mutated up to 1000 times, if it is still the same a random rule will be generated
mutateprevious: mutate previously mutated world
world slider: switch active world and rule
examples: Example rules. Push initiateexample to view some rules.
setup: Restarts the model. There is no need to press this unless you encounter some crazy errors i think
clearturtles: Clears all turtles. This is useful when the neural network visualization failed for some reason.
get/set: get the current rule or set the current rule on the rule input field.
patchstate: the current value of the patch where the mouse is located
continue?: continue or not when hit the bottom of the screen
visualizenetwork: Visualizes currently used neural network. The network is colored according to threshold and weight values. Values above 0 are green and below are blue with increasing whiteness as the absolute value increases. Neurons are also shifted on yaxis according to their threshold values.
NetLogo colors explained: http://ccl.northwestern.edu/netlogo/docs/programming.html#colors
NetLogo math explained: http://ccl.northwestern.edu/netlogo/docs/programming.html#math
visionlevel and coloroffset: patches get their color from: state * (70 + coloroffset) * 10 ^ visionlevel Using a different vision level may reveal the true nature of some patterns. Also it may reveal patterns that emerge only on some visionlevel and stay completely hidden on others. Similar patterns may not be similar at all or vice versa depending on the vision level.
unitchangestrength: exponentially distributed absolute change value for a single neuron threshold or connection weight when mutating
%ofunitstochange: exponentially distributed percentage value for a single layer in the neural network that determines the amount of units to change. In this case "single layer" refers to either weight layer or threshold layer.
table:length data is a valuable input for an quick overview of a rule. Different values enable making some predictions on the nature of a rule
Table ditch point defines algorithm choice. If table:length data > ditchtable then tables will not be filled anymore. The remaining data will still be used if possible though. This results in a minor slowdown, however the overall benefits gained seem to outweigh ditching table usage completely.
In this case a table with 1 million entries is equal to about 122 MB of memory space.
fps: frames per second
operationonrule: all values on the rule field (neuron thresholds and connection weights) are sent trough the "formula". formula must be a valid (in netlogo language) math formula. Please see http://ccl.northwestern.edu/netlogo/docs/dictionary.html#mathematicalgroup for some help. In formula: z is current value from the feedforward neural network a,b and c are constants
All operations are done on the neural network that is in the rule field. After each operation all the rules will be replaced with the resulting rule and mutations of it.
omitzero: in case omitzero is "on", z is 0 and the formula is z + 0.1, value 0 will become 0. Values that are not zero will become z + 0.1
restricttorange?: Patch states, neuron output values and connection weight values are all in range [1,1]. Automatic operations will restrict the resulting values from operationonrule into that range when restricttorange? is "on". If restricttorange? is "off" then the values will be looped in that range instead.
restricttorange input min max observer> show restricttorange 1.01 1 1 observer: 1 observer> show restricttorange 0.56347347 1 1 observer: 0.56347347 observer> show restricttorange 50000000000 1 1 observer: 1
loopinrange input min max observer> show loopinrange 0.5 1 1 observer: 0.5 observer> show loopinrange 1.1 1 1 observer: 0.8999999999999999 observer> show loopinrange 1.2 1 1 observer: 0.8 observer> show loopinrange 2 1 1 observer: 0 observer> show loopinrange 400.335 1 1 observer: 0.33499999999997954
zeroborder: If it is "off" all values will be restricted/looped in range [1,1]. If it is on then negative values will be restricted/looped in range [1,0] and positive in range [0,1].
Examples with operationonrule (after loading the model with default settings for formula and related fields): 1)initiateexample 25 2)start the model with go (in order to see the transition) 3)press operationonrule
or 1)initiateexample 3 2)start the model with go 3)press operationonrule 5 times 4)press operationonrule 6 more times 5)press operationonrule 3 more times
THINGS TO NOTICE
Notice how very simple neural networks can produce very complicated behaviour. Visualizenetworks for example rules 12 and 13.
THINGS TO TRY
Play with coloroffset and visionlevel while the model is running to understand how exactly they work.
NETLOGO FEATURES
Each patch on the current row checks if there is a key in the table that corresponds to the states of their 2 closest neighbors and the state of themself in the form of a 3 element list (example [0.1513513613681 0.30628268623 0]) to avoid recalculating the values with the neural network. Tables grow very large, yet this operation does not become any slower.
RELATED MODELS
2d totalistic CA explorer http://ccl.northwestern.edu/netlogo/models/community/totalistic2dCA Netlogo models library: Cellular automata group Artificial Neural Net
