从海龟群中选择领导者NetLogo [英] Leader selection from crowd of turtles NetLogo

查看:84
本文介绍了从海龟群中选择领导者NetLogo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法让我问问/圈出一只乌龟(机器人),说你现在是领导者(也就是将is-leader设置为true).由于我正在使用Robots-own [ is-leader? ]
作为参考,请参见此图像.

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.

推荐答案

鉴于您在评论中对目标的阐述,但要注意塞思(通常)在警告中是完全正确的,您可以尝试以下操作:

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

这篇关于从海龟群中选择领导者NetLogo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆