Population Limit

My computer keeps crashing when I have too many agents. How do I limit how many agents there are?


There are two ways to limit your population. If you only want to limit a particular breed (or you have only one breed), you can use this code:

This means that only if there are less than 500 plankton will they reproduce.
The second way can be used to limit a population across breeds by setting a global counter that keeps track of all the agents in the world, and a global threshold that allows none of the agents to reproduce if the threshold is reached.

Submitted by talaya on 13. March 2008 - 10:21