Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Predator-prey simulation

I'm trying to implement a model of predator-prey. It is agent-based model. Every few milliseconds is a new move. On the field there are two types of creatures: predator and prey. The behavior of each of them is given by the following rules:

Prey:

  1. Just moved to an unoccupied cell
  2. Every few steps creates offspring to his old cell
  3. Life expectancy is limited by the number of moves

Predator:

  1. Predator moves to the cell with prey. If such cells are not, in any free neighboring cell
  2. Same
  3. Same

I have a problem with the choice of prey move. Prey

For example, I have preys in cells 5 and 9. Each of them can move to cell 6. How can I resolve this conflict? Thanks

like image 777
finder_sl Avatar asked Oct 09 '22 23:10

finder_sl


1 Answers

Use asynchronous updating. Iterate through the prey in random order, having them decide in turn to which cell they should move.

This is a common approach in simulations. It has an additional benefit in that it eliminates limit cycles in the dynamics.

like image 96
Michael J. Barber Avatar answered Oct 13 '22 11:10

Michael J. Barber