![]() In general, you should try thinking in terms of agentsets with which you can use the many built-in functions that you will find in the NetLogo dictionnary. It is very rare that loops are the best approach in NetLogo. You're not doing anything with it in your code, but I suspect that any use you might have had in mind would be better served by not any? turtles-here. I see you have an empty patch variable.You would assign it by doing: ask patch 0 -1 or something equivalent. You could have a reserved-by reference instead of a reserved boolean. You can't have a link between a patch and a turtle, but you can store a reference to a turtle in a patch variable.The proper way to refer to the reserved variable of patch 0 -1 is of patch 0 -1.Ifelse (patch -i -1 != nobody and (patch -i -1 = false)) Ifelse ((patch 0 -1 != nobody) and (patch 0 -1 = false)) I am referencing my patch-owned reserved boolean incorrectly, but more importantly, can I link this reservation or some other type of variable to a turtle? patches-own Where the turtle will reserve the closest spot to the destination (and the turtle himself as a tiebreaker as xcor -1 and xcor 1 are the same distance from the destination). The Modeling Commons contains more than 2000 other NetLogo models. In addition to that, I am trying to construct a loop to search for spots closest to my destination (xcor 0). View, run, and discuss the Random Boolean Network model, written by David Weintrop. I thought of linking the turtle and the patch (I am new to this program) but realized that links are turtle-turtle only. I have created a reserved boolean for patches, but do not know how to link this reservation with a specific turtle. It teaches programming concepts using agents in the form of turtles, patches, links and the observer. About NetLogo was designed by Uri Wilensky, in the spirit of the programming language Logo, to be 'low threshold and no ceiling'. I am trying to figure out a way for a car to reserve a parking space (patch) in my world. NetLogo is a programming language and integrated development environment (IDE) for agent-based modeling. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |