Write a program that models an oceanic ecosystem inhabited by predators 🐊 and prey 🐟. The ocean is represented by a two-dimensional array of cells. A cell can contain either a predator, prey, or an obstacle. At each time quantum, the cells are processed sequentially.
Rules:
-
A predator can eat an adjacent prey or simply move to an adjacent cell.
-
Prey can also move to an adjacent cell.
-
If a predator does not eat anything for a certain amount of time, it dies.
-
After specific time intervals, predators and prey reproduce if there is a neighboring empty cell. The offspring occupies the free cell.
The current state of the ocean should be displayed on the screen, ideally using a graphical user interface (GUI). The simulation ends either after a certain number of iterations or when all predators or all prey have died.
Use this model to test the hypothesis of cyclical populations of predators and prey.
You can use src/victims_predators_base.py as a starter.
