A Java-based GUI ecosystem simulation of predator-prey interactions with inheritance-driven species behavior, gene-based evolution mechanics, and real-time visualization. Developed as part of a coursework project.
Includes:
- Predator-prey ecosystem (Deer, Coyote, Grass)
- Genetic traits (mutation, inheritance via
Gene.java) - Real-time visual output via Swing
- Statistics tracking (via
FieldStats.java) - Object-Oriented Programming (OOP) principles throughout
- PDF report outlining design and decisions
Tested on Windows 10/11 and macOS Sonoma using Java 17.
https://github.com/your-username/PreySimulator.git
cd PreySimulatorUlvisAndYaseenjavac *.javajava SimulatorViewYou should see a Swing GUI window visualising the simulation in real time.
- GUI Simulation: Click
Runto watch interactions in real-time. - Species: Deer eat grass; Coyotes hunt deer and etc.
- Genetics: Attributes (e.g., energy, speed) evolve each generation via mutation and inheritance.
- Pause & Rerun: Use GUI controls to step through or restart.
- Launch the app:
java SimulatorView - Observe population changes, hunting behavior, and ecological balance.
- Optionally modify gene parameters in
Gene.javafor experimentation.
📄 The full technical breakdown, design rationale, and testing evaluation can be found in:
- Fork the repo
git checkout -b feature/improvement- Commit:
git commit -am "✨ Improve gene mutation logic" - Push:
git push origin feature/improvement - Open a Pull Request
MIT. See LICENSE.
Nature is beautiful—and now, programmable.