📄 ---perforant.nlogo
字号:
breeds [entorhinal dentategyrus ca3 ca1 neuron1 neuron2]globals [lifespan fade]patches-own [passover]neuron1-own [age]neuron2-own [age]to setup ca entorhinal-setup dentategyrus-setup ca3-setup ca1-setup axon setup-constants ask patches [set passover 0]end to entorhinal-setup ;placement of the entorhinal cortex neurons create-custom-entorhinal 17[ set color green set shape "circle" ask turtle 0 [setxy 2 -20] set heading 180 ask turtle 1 [setxy 2 -20] set heading 175 ask turtle 2 [setxy 4 -18] set heading 170 ask turtle 3 [setxy 6 -18] set heading 165 ask turtle 4 [setxy 8 -16] set heading 160 ask turtle 5 [setxy 10 -16] set heading 155 ask turtle 6 [setxy -2 -20] set heading 185 ask turtle 7 [setxy -4 -18] set heading 190 ask turtle 8 [setxy -6 -18] set heading 195 ask turtle 9 [setxy -8 -16] set heading 200 ask turtle 10 [setxy -10 -16] set heading 205 ask turtle 11 [setxy 13 -14] set heading 150 ask turtle 12 [setxy 12 -15] set heading 145 ask turtle 13 [setxy -16 -12] set heading 140 ask turtle 14 [setxy -12 -14] set heading 210 ask turtle 15 [setxy -14 -14] set heading 215 ask turtle 16 [setxy -16 -12] set heading 180 ]endto DentateGyrus-setup ;placement of the Dentate Gyrus neuronscreate-custom-dentategyrus 13[ set color orange set shape "circle" ask turtle 17 [setxy -4 10] ask turtle 18 [setxy -4 8] ask turtle 19 [setxy -6 6] ask turtle 20 [setxy -6 4] ask turtle 21 [setxy -8 2] ask turtle 22 [setxy -10 0] ask turtle 23 [setxy -12 0] ask turtle 24 [setxy -12 0] ask turtle 25 [setxy -16 2] ask turtle 26 [setxy -18 4] ask turtle 27 [setxy -18 6] ask turtle 28 [setxy -20 8] ask turtle 29 [setxy -20 10] ]endto ca3-setup ;placement of the CA 3 field neuronscreate-custom-ca3 15[ set color blue set shape "circle" set heading 150 ask turtle 30 [setxy 2 22] ask turtle 31 [setxy -12 8] ask turtle 32 [setxy -12 10] ask turtle 33 [setxy -12 10] ask turtle 34 [setxy -12 12] ask turtle 35 [setxy -12 12] ask turtle 36 [setxy -12 16] ask turtle 37 [setxy -12 18] ask turtle 38 [setxy -12 18] ask turtle 39 [setxy -10 20] ask turtle 40 [setxy -8 21] ask turtle 41 [setxy -6 22] ask turtle 42 [setxy -4 22] ask turtle 43 [setxy -2 22] ask turtle 44 [setxy 0 22] ]endto ca1-setup ;placement of the CA 1 Field neuronscreate-custom-ca1 15[ set color red set shape "circle" set heading 250 ask turtle 45 [setxy 3 22] ask turtle 46 [setxy 4 22] ask turtle 47 [setxy 6 22] ask turtle 48 [setxy 8 21] ask turtle 49 [setxy 10 20] ask turtle 50 [setxy 14 16] ask turtle 51 [setxy 14 16] ask turtle 52 [setxy 14 0] ask turtle 53 [setxy 14 14] ask turtle 54 [setxy 14 12] ask turtle 55 [setxy 14 10] ask turtle 56 [setxy 14 8] ask turtle 57 [setxy 14 6] ask turtle 58 [setxy 14 4] ask turtle 59 [setxy 14 2] ]endto axon ;mimics the axon sites in the hippocampusask (patch 0 -20) [ set pcolor green ]ask (patch -14 0) [ set pcolor orange ]ask (patch -12 14) [ set pcolor blue ]ask (patch 12 18) [ set pcolor red ]ask (patch 2 25) [ set pcolor yellow ] ;yellow patches represent regions where incoming signals come from outside the hippocampusask (patch -0 -25) [ set pcolor yellow ]endto setup-constants ; defines the age of the signals. set lifespan 500 set fade 0end to incoming signalendto kill ask neuron1 [die] ask neuron2 [die]end to go ;neuron-signal working-memory stop-wrap grow-older trails ifelse potentiation ;toggles on and off the axon "trails" [ask patches [if any neuron2-here [set pcolor scale-color black passover 0 screen-size-x]]] ;[set pcolor (pcolor + .5)]]] [ask patches [set pcolor 0 set passover 0]] ifelse potentiation ;toggles on and off the axon "trails" [ask patches [if any neuron1-here [set pcolor scale-color black passover 0 screen-size-x]]] ;[set pcolor (pcolor + .5)]]] [ask patches [set pcolor 0 set passover 0] ] deteriorate axonendto trails ;this counts the number of times each signal moves over a patch and allows for the coloring of the patch ask patches [if any neuron2-here [set passover passover + 3]] ask patches [if any neuron1-here [set passover passover + 3]]end to deteriorate ; the triggers the natural decay of any connection in the brain if potentiation [ask patches [set fade (fade + random 3) if fade > 800 [fader] if passover > 50 [passover-catchup]]] ;[set passover (passover - .05)]]] endto passover-catchup set passover (passover - .05)endto fader ;part of the timing mehanism of the deterioration within the connectivity of the brain if passover > 1 [if pcolor > .4 [ set pcolor (pcolor - random .05) set fade 0 set passover (passover - random (alcohol-consumption / 5) + .1)]]endto signal ;Sends incoming signal towards hippocampal formation ask (patch 2 25) [ sprout 1 [ set breed neuron1 set color yellow ]] ask neuron1 [ set heading towards-nowrap patch 12 18 ;fd 2 rt random 360 bk 1 set age (1) ] ask (patch 0 -25) [ sprout 1 [ set breed neuron2 set color yellow]] ask neuron2 [ set heading towards-nowrap patch 0 -20 ;fd 2 rt random 360 bk 1 set age (1)]endto neuron-signal ;orientates the signals towards the recepter site, the pathway taken represents creation of the axons ask neuron1 [set heading towards-nowrap patch 12 18 fd 2 rt random 360 bk 1 ] ask neuron2 [set heading towards-nowrap patch 0 -20 fd 1 rt random 360 bk 2 ] endto stop-wrap ;Keeps the signals from wrapping around the screen edge locals [new-py] ask neuron2 [ set new-py round (ycor + dy) if (abs new-py = screen-edge-y) [ set heading (180 - heading) fd 1 rt random 360 bk 2 lt random 360]]endto working-memory ; An attempt to mimic some form of hippocampal function. i.e. short term working memory store and the cycling of signals ask turtles-at 0 -25 [set color 44] ask turtles [ if color = 44 [ set heading towards-nowrap patch 0 -20 fd 2 rt random 360 bk 1 lt random 360]] ask turtles-at 2 25 [set color 46] ask turtles [ if color = 46 [ set heading towards-nowrap patch 12 18 fd 2 rt random 360 bk 1 lt random 360]] ask turtles-at 12 18 [set color 17] ask turtles [ if color = 17 [set heading towards-nowrap patch 0 -20 fd 2 rt random 360 bk 1 lt random 360]] ask turtles-at 0 -20 [set color 54] ask turtles [ if color = 54 [set heading towards-nowrap patch -14 0 fd 2 rt random 360 bk 1 lt random 360]] ask turtles-at -14 0 [set color 24] ask turtles [ if color = 24 [set heading towards-nowrap patch -12 14 fd 2 rt random 360 bk 1 lt random 360]] ask turtles-at -12 14 [set color 104] ask turtles [ if color = 104 [set heading towards-nowrap patch 12 18 fd 2 rt random 360 bk 1 lt random 360]] ask turtles-at 12 18 [set color 17] ask turtles [ if color = 17 [set heading towards-nowrap patch 0 -20 fd 2 rt random 360 bk 1 lt random 360]] endto grow-older ; this function ages the neurons and causes them to die out with time ask neuron1 [set age (age + random 5) if age > lifespan [ die ] ] ask neuron2 [set age (age + random 5) if age > lifespan [ die ] ] end@#$#@#$#@GRAPHICS-WINDOW4031092054825259.941211000CC-WINDOW32466329570Command CenterBUTTON19218654setupsetupNIL1TOBSERVERBUTTON1002024153Send New SignalincomingNIL1TOBSERVERBUTTON21
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -