0

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.

Seth Tisue
  • 29,985
  • 11
  • 82
  • 149
user397479
  • 33
  • 2

1 Answers1

1

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
  • 8,816
  • 6
  • 43
  • 48