This project explores the fascinating dynamics of artificial life by simulating a world inhabited by diverse agents. Inspired by the principles of natural selection, these agents interact, compete, and evolve over time.
This Java-based simulation models a dynamic environment where agents with distinct characteristics interact and evolve. It provides a platform to observe how complex system-level behaviours can arise from relatively simple individual rules.
The heart of this simulation lies in the agents, each endowed with a unique set of genes. These genes influence their behaviour, appearance and interactions with the environment.
Agents engage in a variety of interactions:
- Plants: These static organisms serve as the foundation of the food chain, providing sustenance and gradually regenerating.
- Herbivores: These mobile agents exhibit a range of behaviours, including resting, foraging, feeding, mating, and navigating the world based on their needs and instincts.
- Reproduction: Agents reproduce, passing on their genetic information to their offspring.
- Mutations: Occasional mutations introduce genetic variations within the population, driving the evolutionary process.
- Natural Selection: The fittest agents, those best adapted to their environment, are more likely to survive and reproduce, leading to the gradual evolution of the population.
See it in action! There are two ways to visualize the simulation:
Experience the simulation through a minimal text-based interface.
a-life-2020-06-30_22.27.20.mp4
Immerse yourself in a visually rich representation of the world.
a-life-2021-11-25.webm
- Background color: Reflects the agent's current mood based on its needs
- Background transparency: Indicates the agent's vitality (energy and hunger levels).
- Border thickness: Represents the agent's age (thin: young, thick: adult, gray: old).
- Blue square around an agent: Represents the agent's field of vision.
Gain deeper insights into the agents' internal states by tracking their attributes at each simulation tick. This window provides a detailed view of individual agent behaviour and how it changes over time.
Note: This is a personal project for learning and exploration.