This page was automatically generated by NetLogo 4.1. Questions, problems? Contact feedback@ccl.northwestern.edu.
The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Sun's Java site. If the display appear cut off with Firefox, then try another browser (Safari works).
powered by NetLogo
view/download model file: Hopfield-update.nlogo
This section could give a general understanding of what the model is trying to show or explain.
This section could explain what rules the agents use to create the overall behavior of the model.
This section could explain how to use the model, including a description of each of the items in the interface tab.
This section could give some ideas of things for the user to notice while running the model.
This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.
This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.
This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.
This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.
This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.
breed [centrals central]
breed [neurons neuron]
undirected-link-breed [connections connection]
centrals-own [ state local-field ]
neurons-own [ state ]
connections-own [ weight ]
to setup
ca
create-centrals 1
create-neurons 10
ask centrals
[ set size 3
randomize-state
set local-field 0
create-connections-with neurons
[ initialize-connections ]
]
layout-radial neurons connections (central 0)
ask neurons [ initialize-neurons ]
end
to initialize-neurons
set size 2
randomize-state
show-state
end
to randomize-state
set state 2 * random 2 - 1
show-state
end
to initialize-connections
randomize-weight
end
to randomize-weight
set weight random-float 20 - 10
ifelse weight > 0
[ set color scale-color red weight -10 20 ] [
ifelse weight < 0
[ set color scale-color blue weight 10 -20 ]
[ set color grey ]]
set label round (10 * weight) / 10
end
to show-state
ifelse state > 0
[ set color red set heading 0 ]
[ set color blue set heading 180 ]
end
to calculate-local-field
ask centrals [
set local-field sum [partial-field] of neurons
]
ask patches ; with [(abs pxcor) + (abs pycor) < 10]
[
let LF [local-field] of central 0
ifelse LF > 0
[ set pcolor scale-color red (LF / (pxcor ^ 2 + pycor ^ 2 + 1)) 0 20 ]
[ set pcolor scale-color blue (LF / (pxcor ^ 2 + pycor ^ 2 + 1)) 0 -20 ]
]
end
to-report partial-field
report state * [weight] of connection-with central 0
end
to update-central
ask centrals [
ifelse local-field > 0
[ set state 1 ]
[ set state -1 ]
show-state
]
end