A modular evolution simulation where digital organisms compete, adapt, and evolve
The Story
J-15 began as an exploration of a fundamental question: What happens when you let digital life follow its own rules?
Inspired by Richard Dawkins' concept of the "selfish gene," this simulation models organisms not as cooperative entities,
but as vessels for their genetic material—DNA configurations that seek only to replicate and persist across generations.
In this world, organisms inhabit procedurally generated terrain, compete for resources, hunt or photosynthesize for energy,
and reproduce when conditions allow. Each organism carries a unique DNA blueprint that determines its traits, behaviors,
and survival strategies. Through mutation and selection, populations evolve—sometimes thriving, sometimes collapsing into extinction.
"We are survival machines—robot vehicles blindly programmed to preserve the selfish molecules known as genes."
— Richard Dawkins, The Selfish Gene
J-15 brings this philosophy to code: no intelligent design, no predetermined outcomes—only the relentless logic of survival and replication.
The Case for Simulation
Evolution is often discussed in abstract terms, but simulation makes it tangible. J-15 serves multiple purposes:
Educational Value
Understanding evolutionary dynamics through direct observation. Watch populations adapt to environmental pressures in real-time,
see genetic drift in action, and observe emergent behaviors that arise from simple rules.
Research Platform
A testbed for exploring evolutionary algorithms, genetic diversity, population dynamics, and the interplay between
competition and cooperation. The modular architecture allows researchers to inject custom systems and policies.
Computational Experimentation
Unlike biological evolution which unfolds over millennia, digital evolution operates at computational speed.
Hundreds of generations can be simulated in minutes, allowing rapid iteration and hypothesis testing.
Terrain Dynamics
Procedurally generated land and water environments with elevation-based ecosystems
Genetic Diversity
DNA-driven traits with mutation-based variation across generations
Resource Competition
Limited energy and space force organisms to compete for survival
Event-Driven
Decoupled architecture using publish-subscribe patterns for modularity
Architecture
J-15 employs a modular, event-driven architecture designed for extensibility and maintainability.
The system separates concerns across multiple layers:
Core Components
World: The central orchestrator managing systems, events, and the simulation lifecycle
Environment: Coordinates terrain, organisms, and capacity policies for spatial management
Terrain: Procedurally generated using NumPy and SciPy with configurable water/land ratios
Organisms: Entities with DNA-defined behaviors, energy management, and lifecycle methods
Event Bus: Pub-sub architecture for decoupled component communication
Strategy Pattern: Pluggable capacity policies and behavior systems
Factory Pattern: DNA and terrain generation through factory methods
Observer Pattern: Event handlers react to simulation lifecycle events
System Composition: Modular systems extend World functionality
Genetic Algorithms & Evolution
At the heart of J-15 lies a genetic algorithm that mirrors biological evolution through computational processes.
The DNA Blueprint
Each organism carries a DNA object encoding its characteristics:
Type: Plant or animal classification
Habitat: Land, water, air, or amphibious preferences
Diet: Herbivore, carnivore, omnivore, or photosynthetic
Genes: Continuous values (0.0–1.0) affecting size, reproduction rate, offspring ratio
Mutation & Variation
When organisms reproduce, their DNA is replicated with random mutations applied to gene values.
This introduces variation—the raw material of evolution. Mutations follow a normal distribution
around the parent's values, creating offspring that are similar but not identical.
Selection Pressure
Not all organisms survive. Limited resources, predation, energy depletion, and environmental constraints
create selection pressure. Organisms with favorable trait combinations are more likely to survive long enough
to reproduce, passing their genes to the next generation.
Emergent Complexity
From these simple mechanisms—replication, mutation, and selection—complex behaviors emerge:
Population booms and crashes as resources fluctuate
Specialization into ecological niches (shallow water vs. deep water organisms)
Predator-prey dynamics with arms races in size and speed
Genetic drift in small, isolated populations
The simulation doesn't enforce outcomes—it provides the rules. Evolution does the rest.
The Selfish Gene Connection
Richard Dawkins' landmark 1976 book The Selfish Gene revolutionized how we think about evolution
by shifting perspective from organisms to genes themselves.
Gene-Centered Evolution
Dawkins argued that genes, not organisms or species, are the fundamental units of selection.
Organisms are temporary vehicles—"survival machines"—constructed by genes to ensure their own replication.
This perspective explains seemingly altruistic behaviors, cooperation, and even self-sacrifice as strategies
that benefit gene propagation.
Simulation as Metaphor
J-15 embodies this gene-centered view. Organisms in the simulation don't "want" to survive—their DNA drives
behavior through encoded parameters. An organism's actions (eating, moving, reproducing) emerge from its genetic
configuration, not conscious intent.
Replicators vs. Vehicles
In J-15, the DNA class represents the replicator—the information that persists across generations.
The Organism class is the vehicle—the temporary entity that carries DNA through a single lifetime.
This mirrors Dawkins' central thesis: genes are immortal (through copies), organisms are mortal.
Computational Selfish Genes
Every reproduction event in J-15 involves DNA replication with mutation. Successful genetic configurations
proliferate; unsuccessful ones vanish. There is no fitness function imposed from above—fitness emerges
from the interaction between genetic traits and environmental challenges.
"Let us try to teach generosity and altruism, because we are born selfish."
— Richard Dawkins, The Selfish Gene
Unlike biological life, we can observe J-15's digital genes directly—watching them compete, mutate, and
evolve in a compressed timescale that makes evolution's mechanisms visible and undeniable.