Rafaela
Rafaela

Reputation: 449

How to hide part of agents in NetLogo 6.2?

I have a 5x5 world with 10 agents in each patch in the world. I would like to hide almost everyone and only make one or 5 agents visible in the world to see their way. I only know how to do this by inspecting each agent in the interface and asking to hide it. But, I think there must be some easier way to ask to hide the 245 agents and make 1 or 5 agents visible in the world. Does anyone have any suggestions how I can do this?

Upvotes: 0

Views: 181

Answers (1)

Steve Railsback
Steve Railsback

Reputation: 1736

Sure- there are turtle commands hide-turtle and show-turtle.

You could, for example, use this code either in setu or in a button on the interface:

 ask turtles [hide-turtle] ; hide all the turtles
 ask n-of 5 turtles [show-turtles] ; un-hide 5 of the turtles, selected randomly

Upvotes: 1

Related Questions