Reputation: 33
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.
Upvotes: 0
Views: 520
Reputation: 9142
1)To check the color of a turtle/agent you can do:
let the-agent ...get the agent some way...
if ( [color] of the-agent = orange) [show "the agent is orange"]
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.
Upvotes: 1