NetLogo编程问题:检查代理颜色/让品种相互传递

NetLogo编程问题:检查代理颜色/让品种相互传递,netlogo,traffic-simulation,Netlogo,Traffic Simulation,NetLogo中的一些基本编程问题: 1) 在是代理?值命令中。如何特别检查id=4的代理是否为绿色 相比之下,是代理吗?绿色仅当任何代理为绿色时才为真 2) 我制造了两种类型的代理,当它们相互碰撞时停止。我怎样才能让他们互相超越 谢谢。1)要检查海龟/代理的颜色,您可以执行以下操作: let the-agent ...get the agent some way... if ( [color] of the-agent = orange) [show "the agent is orang

NetLogo中的一些基本编程问题:

  • 1) 在
    是代理?
    命令中。如何特别检查id=4的代理是否为绿色

    相比之下,
    是代理吗?绿色
    仅当任何代理为绿色时才为真

  • 2) 我制造了两种类型的代理,当它们相互碰撞时停止。我怎样才能让他们互相超越

谢谢。

1)要检查海龟/代理的颜色,您可以执行以下操作:

let the-agent ...get the agent some way...
if ( [color] of the-agent = orange) [show "the agent is orange"]
2) 我很困惑。netlogo中的海龟不会相互碰撞,默认情况下,它们会相互越过。唯一能阻止乌龟“前进”的是网格的末端。你一定写了一些代码,使它们相互冲突