views:

27

answers:

1

hi

i have some basic programming questions in netlogo:

*1)*in "is-agent? " command. how can i specifically check if the agent with id = 4 is green or not.

is-agent? green ;; this would 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.

thanks

A: 

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.

Jose M Vidal