netlogo

probability for variable value in agentsets, netlogo

天大地大妈咪最大 提交于 2019-12-12 04:17:13
问题 I am trying to use probability to assign [0] or [1] individual values for a turtles-own variable in NetLogo, but have only found ways of printing or reporting probability outputs rather than using them to determine a variable value. Example: I am asking two turtles to check whether they each want to exchange information with each other, and have assigned a variable exchangeinfo. If exchangeinfo = 0, then no information exchange happens. If exchangeinfo = 1, then information exchange occurs.

Headless Behavior Space with table extension

大憨熊 提交于 2019-12-12 04:03:54
问题 I currently have a project that I've completed using the netlogo interface. My project includes multiple .nls files and one of my .nls files use the table extension. I've created a behavior space experiment and named it experiment for simplicity. I'm trying to run the experiment headless using the following commands in my Netlogo application's directory where the Netlogo.jar is located. java -Xmx1024m -Dfile.encoding=UTF-8 -cp ./Netlogo.jar org.nlogo.headless.Main --model /path/to/file

Count neighbors turtles of a specific patch and report true or false

余生颓废 提交于 2019-12-12 03:57:09
问题 Hello i will try to be quick I have a room with a fire that expands , and i have two exits , all i want to do is say to agents that if a door is blocked by fire then to go to the other one. i came up with something like this but not result. to doorblock show count neighbors with [pcolor = 77] ;; the patch color of the two doors end ;;to go ask smarts [ ;;smarts are the agents inside the room that need to get oout if [ doorblock > 5 ] [ set target one-of sexits]] ;;sexits is the other door

NetLogo BehaviorSpace Slows after several experiments

半城伤御伤魂 提交于 2019-12-12 03:34:24
问题 I am using BehaviorSpace. At first it worked great, completing 80 runs in less than one hour. After doing about 10 different experiments in BehaviorSpace, it is now running at a considerably slower rate (almost to a halt), and now I am getting an error of "out of memory". I use clear-all as the first command in my setup procedure, but it seems like NetLogo is holding some memory over from previous runs. I have tried switching to table output, and disabled spreadsheet output, but still got an

Sprouting turtles in between extended issue

孤者浪人 提交于 2019-12-12 02:55:50
问题 This is question is an extension of the previous question. Netlogo Sprouting turtles at regular intervals On runnning the code and set the turtle size to about 0.4. I face the following issue:(Check figure below) In figure 2, you can notice the black gap where there no turtles. This is undesirable and is what I am intending correct. So in a way the sprout should begin at the edge of patch instead the center. Thanks. CODE:(Answer by Nicolas Payette on Question) to fill-wall [ d ] set d

Need help on speeding up a particle system (or how to ask turtles not to ask other turtles.)

允我心安 提交于 2019-12-12 02:27:58
问题 As a toy, it works well but obviously, when It scales up it bogs down. How can I do this system without asking turtles to ask the other turtles? the code is thus. to go ask turtles [ ask other turtles [ set heading towards myself let D distance myself let C .1 / D - 1 / (D ^ 2) if C > 1 [set C 1] fd C ] ] tick end I should know how to do this but the brain is not working. I will race y'all to the answer and post my own if I get it first. 回答1: You're doing essentially an N-body simulation. The

Distribute turtles on patches

ぐ巨炮叔叔 提交于 2019-12-12 02:07:04
问题 let pop area * density distribute-turtles to distribute-turtles [ pop box ] if (pop > count box) [ error "Box can't hold all turtles!" ] ask n-of pop box [sprout-inboxturtles 1[ set color blue set exit true ;ignore set alpha alpha-exit ;ignore set beta beta-exit ;ignore set size 0.9 ] ] end The above code distributes turtles on patches. box -patches pop -number of turtles I will create turtles such in accordance to the density within the box such that: a.) no 2 turtles have the same centre,

Trouble with advanced netlogo code involving a question mark

只谈情不闲聊 提交于 2019-12-12 00:52:21
问题 I am using Netlogo v6.0.4 and I'm getting the following error message when I try to run sample code from an answer I found here on Stack Overflow. Nothing named ? has been defined In this answer the following netlogo code is proposed as an answer: to-report split [ string delim ] report reduce [ ifelse-value (?2 = delim) [ lput "" ?1 ] [ lput word last ?1 ?2 but-last ?1 ] ] fput [""] n-values (length string) [ substring string ? (? + 1) ] end The specific ? it does like is the first one in

NetLogo: n-of error when all turtles die

[亡魂溺海] 提交于 2019-12-11 20:51:24
问题 I have a simulation where turtles walk onto red patches and die, which works, but everything that has n-of in it reports an error as soon as most of/all turtles are dead. I do understand the error, since the simulation tries to get n-of while there is no turtle left, but how do i fix that? Is there a way to use n-of when at the end of the simulation all the turtles are dead? If there is, how do I do it?, and if not, is there an alternative way to making the turtles die on red patches? My

NetLogo: histogram relative frequency

送分小仙女□ 提交于 2019-12-11 19:15:29
问题 I'm still having problems with [histogram] . I have a global variable (age-sick) that stores the age of the turtles when they got sick...and I want to plot the distribution: histogram age-sick However I do not want the absolute number of turtles who got sick per every age, rather the relative one . Is there a way to do so? 回答1: I have tried to overcome the problem in the following way:​​ let age-freq (list) let i 0 while [ i <= (max age-sick)] [ let a filter [? = i] age-sick repeat (length a