jacek_podwysocki
jacek_podwysocki

Reputation: 807

Dynamically create turtles

Is there any way to dynamically create turtles?

Whenever I try to create new random turtle in my "go" procedure, I get an error that I can't use crt in a turtle context. I need to be able to add some more turtles "on the fly" and creating a lot of invisible turtles looks like a dirty solution to me as well as it dramatically increases size of the model.

Any ideas?

Upvotes: 2

Views: 242

Answers (1)

Alan
Alan

Reputation: 9620

While turtles can hatch turtles, you really should rewrite go so that it is not a turtle proc! See

https://ccl.northwestern.edu/netlogo/docs/programming.html#ask

Upvotes: 2

Related Questions