A high-performance, 3D agent-based simulation engine built with Java and Processing. This project simulates complex emergent behaviors including biological evolution (predator-prey dynamics) and social clustering (opinion dynamics) within a voxel-based world.
The simulation runs in a 3D grid where different types of agents interact, evolve, and survive. It features a dual-window architecture:
- Visualizer (OpenGL/P3D): A real-time 3D render of the world.
- Telemetry Dashboard (Swing): A control center for managing simulations, viewing real-time graphs, and spawning headless background workers.
- Hybrid Rendering Engine: Supports both "Legacy" immediate mode and high-performance "Batch" rendering (using
GL_QUADS) to handle thousands of agents at 60+ FPS. - Spatial Hashing: Custom spatial partition system (
World.java) for O(1) neighbor lookups, optimizing collision and perception checks. - Multi-threaded Simulation: Run multiple "Headless" simulations in the background without rendering overhead to gather statistical data faster.
- Evolutionary Mechanics:
- Bacteria: Mutate virulence levels and evolve dormancy strategies based on energy availability.
- Host Cells: Evolve resistance to infection; stress triggers high-mutation reproduction.
- Voters: Demonstrate social segregation (Schelling's model) based on political opinion.
- Language: Java (JDK 19)
- Build System: Maven
- Graphics: Processing 3 Core (P3D) & JOGL (OpenGL)
- UI: Java Swing (Telemetry Dashboard)
- Java JDK 19 or higher
- Maven
- Clone the repository.
- Build the project using Maven:
mvn clean install