Nicholas A. Yager


Types of time for simulations

22 Nov 2013

For the last few weeks a couple of colleagues and I have been modeling competition in pollinating plants under ecology professor Dr. Gregg Hartvigsen. In our particular research, a 2D spatial simulation consisiting of agents simulate plant and bee behavior. At face value, the model looks similar to cellular automata, but in this case the rules are slightly more complex.

Simulation domination

Figure 1: An early run of our model's first version. This is a typical domination case, where one species out competes another. This version, however, is flawed in the evaluation of discrete time, in which some cells have reproduction bias.

After we started testing our model, we realized a massive mistake: we biased some plants over others when we handled time. This led to a question of if we should adapt our model to use continuous time or discrete time and what those two approaches would entail.

Continuous time resolves stack bias by psudo-randomly evaluating one agent each time step. Since there is no stack to determine the order of pollination and reproduction, so long as the evaluations are random, there can be no bias. Stack bias can be removed in discrete time by either randomizing the stack, which effectively changes the reproduction order each time step, or by allocating open cells to particular neighbors for pollination, preventing a potential bias.

So far, we have implemented a continuous time solution and are seeing how it effects our results. Superficially, the simulations take considerably more time steps to come to a takeover event.

Continuous time

Figure 2: The world in a continue time simulation. Each time step accounts for a smaller amount of change in the simulation, and as such there is less bias in the order that changes take place. As a side note, rendering a 20000 segment GIF takes a long time, so a time series seems more apt .

The continuous-time model has the definite disadvantage of creating more data output for later processing, as well as slowing down the simulated processes. As an upside, however, this approach allows for very detailed agent-based simulations to be evaluated on a highly individual level.

Discrete time handles stack bias by preallocating the future modification of a location to a random neighbor every tick, allowing each cell to be modified based on the current state of the world separately. This new world then replaces the old world for the next tick to compute.

Discrete time

Figure 3: The discrete time model. This approach allows for the entire world to be evaluated at each time step, whilst simultaneouly eliminating bias associated with the order in which the cells are chosen.

All in all, either type of simulation is perfectly valid. They both allow for unbiased stochastic processes. In our case, the ability to analyze the data is just as important as the simulation, and as such ten times more data is hassle, not a benefit. For that reason, our mutualism and competition research uses the discrete approach for our statistical analysis.

Discrete gif

Figure 4: The matrix plot of a discrete world over time. This torus world evaluates all of the plants at once and does so without a bias in reproduction.

Figure 4 is a bonus animation of the newest version of the simulation. This research will be the focus of another post in the near future.

Return to home...