An evolution simulator built with Java and JavaFX. Organisms with individual genomes roam a toroidal map, forage for plants, reproduce, pass on (and mutate) their genes, and eventually die — letting you observe natural selection in real time.
Course project for Object-Oriented Programming at AGH University of Science and Technology (2025).
Variant 3 / C · Authors: Kamil Baran, Katarzyna Kucharzyk
| Area | Details |
|---|---|
| Genetics | Genome crossover, random mutation, configurable genome length |
| Ecosystem | Plant growth, energy management, reproduction thresholds |
| Maps | Base (standard) and Cultivated map variants with soil-state mechanics |
| Simulation | Configurable via JSON presets — population, energy, map size, mutation rates |
| Visualisation | Live JavaFX GUI with real-time map rendering |
| Statistics | CSV logger tracks population, avg. energy, dominant genotype and more |
| Testing | JUnit 5 tests for core model, genetics, and utilities |
agh.darwinworld
├── Main.java / SimulationEngine.java # Entry point & simulation loop
├── app/
│ ├── MainApp.java # JavaFX application
│ └── SimulationPresenter.java # FXML controller
├── model/
│ ├── Animal, Vector2d, MapDirection, ... # Core domain
│ ├── genetics/ # Genotype, crossover, mutation
│ └── map/ # WorldMap, BaseMap, CultivatedMap, Plant
├── stats/
│ └── CsvLogger.java # Simulation statistics export
└── utils/
└── ConfigManager.java # JSON configuration loader
- Java 25+
- Gradle (wrapper included)
# Clone
git clone https://github.com/kamilbarann/DarwinWorld.git
cd DarwinWorld
# Run
./gradlew runEdit or create JSON presets in the presets/ directory to customise simulation parameters such as map dimensions, initial population, energy values, and mutation rates. The configuration is loaded automatically via ConfigManager.
./gradlew testMIT