Leader selection from crowd of turtles NetLogo

荒凉一梦 提交于 2019-12-24 17:10:02

问题


Is there any way that i should ask / make the circled one turtles( robots ) that you are leaders now (i.e. setting is-leader? true for them ). As i am using Robots-own [ is-leader? ]
For reference please see this image.


回答1:


Given your elaboration on your goal in your comments, but noting that Seth is (as usual) completely correct in his warnings, you could try the following:

turtles-own [is-leader?]

to setup
  ca
  ask n-of 50 patches [sprout 1]
  choose-leaders
end

to choose-leaders
  ask max-n-of 5 turtles [count turtles in-radius 3] [
    set is-leader? true
  ]
end



回答2:


I can see no commonality between the circled turtles, except that they are circled. I will therefore interpret the question to ask about how to interact with turtles via the GUI. If you right click on a turtle, you can pick it from a menu, and then choose "Inspect" from the next menu. This will bring up a dialogue box that includes all the turtle's attributes, including its custom attributes. You can use this to set its is-leader? attribute to true.

hth.



来源:https://stackoverflow.com/questions/25782908/leader-selection-from-crowd-of-turtles-netlogo

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