Improve documentation and add main evolution simulation#1
Open
MatejGomboc-Claude-MCP wants to merge 20 commits intoMatejGomboc:masterfrom
Open
Improve documentation and add main evolution simulation#1MatejGomboc-Claude-MCP wants to merge 20 commits intoMatejGomboc:masterfrom
MatejGomboc-Claude-MCP wants to merge 20 commits intoMatejGomboc:masterfrom
Conversation
- Add project overview and features - Document the instruction set - Add build instructions - Include usage examples - Document project structure - Keep original license information
- Create Organism class to wrap programs with fitness - Implement EvolutionSimulation class with: - Population management - Fitness evaluation - Tournament selection - Evolution with elitism - Statistics tracking - Add command line argument parsing - Demonstrate basic evolutionary loop
- simple_math.txt: Demonstrates basic arithmetic operations - loop_example.txt: Shows loop control flow - condition_example.txt: Demonstrates conditional execution - logic_operations.txt: Shows logical operations
- Add class documentation explaining the Program concept - Document all public constants - Add detailed method documentation - Explain the role of each private member - Use Doxygen-style comments for better documentation generation
- Create simple test program with basic instructions - Ensures test-save-load can run successfully
- MATE_REQUEST: Request mating with another organism - CONSUME_FOOD: Attempt to consume food - MATE_ACCEPT: Accept mating request - ROCK_PAPER_SCISSORS: For conflict resolution
- Add Organism class with energy system - Add Food class for consumption - Add World class to manage interactions - Add mating request/acceptance system - Add rock-paper-scissors conflict resolution - Define energy constants and depletion rates
- Implement energy depletion and management - Implement mating request/acceptance logic - Implement food consumption - Implement rock-paper-scissors conflict resolution - Add world update logic to remove dead organisms - Simple genetic inheritance for offspring
- MateRequest takes partner index address and result address - Reads partner ID from memory - Stores success/failure result in memory - Will interface with World class in main simulation
- ConsumeFood takes food index address and result address - Reads food ID from memory - Stores success/failure result in memory - Will interface with World class for actual consumption
- MateAccept takes requester index address and result address - Reads requester ID from memory - Stores success/failure result in memory - Will trigger actual mating process in World class
- Takes choice address, opponent address, and result address - Reads choice (0=rock, 1=paper, 2=scissors) and opponent ID - Stores game result (-1=loss, 0=tie, 1=win) in memory - Will interface with World class for actual game resolution
- Add biological_sim.cpp and biological_sim.h - Add new instruction implementations: - mate_request - consume_food - mate_accept - rock_paper_scissors
- Add includes for new instruction types - Add string parsing factories for: - MATE_REQUEST - CONSUME_FOOD - MATE_ACCEPT - ROCK_PAPER_SCISSORS - Add byte array parsing factories for all new instructions - Implement proper parameter parsing for each instruction type
- Replace basic simulation with BiologicalEvolutionSimulation - Integrate World class for organism management - Add energy-based survival and natural selection - Implement mating and reproduction with energy costs - Add food consumption simulation - Add conflict resolution using the defined system - Track age, energy, and fitness for each organism - Implement population dynamics with extinction possibility - Add comprehensive statistics including energy and age
- Update overview to mention biological features - Add biological instructions to instruction set - Document energy system and depletion mechanics - Explain mating and reproduction system - Document conflict resolution process - Add command line parameters for evolution-sim - Include biological simulation details section - Update project structure with new files
- biological_behavior.txt: Shows food consumption and mating requests - mating_sequence.txt: Demonstrates mating request and acceptance - survival_strategy.txt: Complex behavior with food, conflict, and mating - conflict_resolution.txt: Rock-paper-scissors conflict example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR significantly improves the Evolution-Simulation project by adding comprehensive documentation, a main simulation program, example files, and new biological simulation features.
Changes Made
📚 Documentation
🚀 New Features
Main Evolution Simulation Program (
evolution-sim/)🧬 Biological Simulation Features
Energy System:
New Instructions:
MATE_REQUEST: Request mating with another organismMATE_ACCEPT: Accept a mating request from another organismCONSUME_FOOD: Attempt to consume food for energyROCK_PAPER_SCISSORS: Conflict resolution mechanismConflict Resolution System:
World Management:
📝 Examples
examples/directory with sample programs:simple_math.txt- Basic arithmetic operationsloop_example.txt- Loop control flow demonstrationcondition_example.txt- Conditional executionlogic_operations.txt- Logical operationsbiological_behavior.txt- Food consumption and matingmating_sequence.txt- Mating request/acceptance flowsurvival_strategy.txt- Complex survival behaviorsconflict_resolution.txt- Rock-paper-scissors example🔧 Improvements
program.husing Doxygen-style commentss0.txttest file for test-save-loadbiological_sim.h/cppfor biological simulation componentsImplementation Details
Biological Components
Energy Dynamics
Genetic Inheritance
Testing
The changes maintain backward compatibility while adding new functionality. The existing test-save-load program now has the required test file and should run successfully.
Build Instructions
Future Enhancements
This PR lays the groundwork for further improvements:
Thank you for creating this interesting genetic programming framework! The biological features add a new dimension of realism to the evolution simulation, allowing for emergent behaviors related to survival, reproduction, and resource management.