NetLogo 编程问题:检查代理颜色/品种是否相互传递
NetLogo 中的一些基本编程问题:
1) 在
is-agent?
value 命令中。如何具体检查 id = 4 的代理是否为绿色?相比之下,
is-agent? green
仅当任何代理为绿色时才为 true。2)我制作了两种代理,当它们相互碰撞时它们就会停止。我怎样才能让它们互相越过?
谢谢。
Some basic programming questions in NetLogo:
1) In the
is-agent?
value command. How can I specifically check if the agent with id = 4 is green or not?By contrast,
is-agent? green
would only be true if any of the agents is green.2) I have made two breeds of agents and they stop when they collide with each other. How can I make them pass over each other?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1)要检查海龟/代理的颜色,您可以执行以下操作:
2)我很困惑。 netlogo 中的海龟不会互相碰撞,默认情况下,它们会互相越过。唯一能阻止乌龟“前进”的就是网格的末端。您一定编写了一些使它们发生冲突的代码。
1)To check the color of a turtle/agent you can do:
2) I'm puzzled. Turtles in netlogo do not collide with each other, by default, they pass over each other. The only thing that can stop a turtle from going "forward" is the end of the grid. You must have written some code that makes them collide.