This project simulates the interaction between a shark (predator) and a school of fish (prey) in a 2D environment.
It models schooling behavior, predator avoidance, and pursuit dynamics using numerical methods, visualization, and randomness.
Developed as part of the Masterโs in Next-Level Engineering (MNLE) program.
- Realistic schooling fish dynamics (attraction, spacing, randomness).
- Predator behavior with pursuit, attack radius, and eating latency.
- 2D simulation with animated visualization of predatorโprey interactions.
- Adjustable parameters: fish count, shark speed, attraction strength, randomness, etc.
- Python
- Numerical & AI libraries:
NumPy,Pandas,Torch - Visualization:
Matplotlib,FuncAnimation,tqdm - Utilities:
IPython.display(for inline animations in Jupyter Notebooks)
Example Output The animation shows: ๐ Blue arrows โ live fish schooling. โซ Black markers โ dead fish. ๐ฆ Red/Orange arrows โ shark (red = attacking, orange = searching)
Next Steps Extend to multiple sharks and multiple schools of fish. Explore emergent behaviors with varying parameters. Apply reinforcement learning for predator/prey strategy optimization.
Clone the repository and run the simulation script:
git clone
python simulation.py
'''.##'''