What is the sequence of Netlogo execution?

╄→гoц情女王★ 提交于 2019-12-12 12:48:45

问题


Have I got this correct please?

If I write:

ask turtles
[go_forward
go_backward]

is it correct that a random turtle will move forward then move backward, and then a second random turtle will do the same, and so on? As opposed to:

ask turtles [go_forward]
ask turtles [go_backward]

which will get all turtles in a random order to move forward, and then all turtles in a (different) random order to move backward.


回答1:


That is correct. There's a very similar example right at the end of the section on ask in the NetLogo Programming Guide: http://ccl.northwestern.edu/netlogo/docs/programming.html#ask

See also Ask Ordering Example, in the Code Examples section of NetLogo's Models Library.



来源:https://stackoverflow.com/questions/34872363/what-is-the-sequence-of-netlogo-execution

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!