A Rust-based evolution simulation project that visualizes and simulates evolutionary processes. Watch as digital organisms evolve and adapt their behavior through natural selection in a dynamic environment.
Simul-Evo is an artificial life simulation that models evolutionary processes in a 2D environment. Each organism follows a set of instructions that determine its behavior, and these instructions can mutate and evolve over generations. Organisms must manage their energy, interact with their environment, and compete or cooperate with others to survive.
- Real-time visualization of evolutionary processes
- Complex organism behavior through instruction-based programming
- Environmental interactions including walls and messages
- Energy-based survival mechanics
- Mutation and reproduction systems
- Configurable simulation parameters
- Rust (edition 2021)
- Cargo (Rust's package manager)
-
Clone the repository:
git clone https://github.com/yourusername/simul-evo.git cd simul-evo -
Build the project:
cargo build --release
Run the simulation:
cargo run --releaseOrganisms in the simulation can perform various actions through their instruction set. Here are the categories of available instructions:
Direction modifiers affect the NEXT directional instruction:
Left,Right,Back- Change direction for next instructionRnd- Random direction for next instruction- Example:
Left Movemoves left,Rnd Turnturns to random direction
Still- Stay in place (gains energy)Move- Move forward (or use direction modifier:Left Move)Jump- Jump two cells forward (or use modifier)Turn- Turn in direction (requires modifier:Right Turn)
IfEmpty,IfWall- Check adjacent cell (useNotto invert)IfSimilar,IfIdentical- Compare with nearby organismsIfSmaller,IfYounger,IfLessEnergy- Comparisons (useNotfor bigger/older)IfFlag,IfPosCounter,IfNegCounter- Agent state checksRandomly,Often,Rarely,VeryRarely- Probability-based skips
Not- Inverts the next conditional (e.g.,Not IfEmpty= if occupied)
DestroyWall,BuildWall- Wall manipulation (use direction modifier)Defend,DefendX2toDefendX5- Defensive stanceAttack,Share,Push- Direct interaction with other agentsMsgBlue,MsgRed,MsgGreen- Leave colored messagesIfMsgBlue,IfMsgRed,IfMsgGreen- React to messages
Bond,Unbond- Create/break bonds with adjacent agentsIfBonded,IfAnyBond- Check bond stateShareBonded,SpawnBonded- Coordinated actions
Restart- Return to start of programSkip...Until- Loop constructTag,GoToTag,BackToTag- Program markers and jumpsEndIf,Else- Block terminators
FlagTrue,FlagFalse,FlagFlip- Internal flag stateIncCounter,DecCounter,ResetCounter- Counter operationsYellFlag,YellCounter- Copy state to adjacent agent
Each instruction consumes energy, and organisms must balance their actions with energy management to survive and reproduce.
Run with --help-instructions for complete instruction reference.
This project is licensed under the terms included in the LICENSE file.
Contributions are welcome! Please feel free to submit a Pull Request.