feat: add oasis and river ecosystem simulation examples#27
Open
YJack0000 wants to merge 1 commit into
Open
Conversation
Add two rich simulation examples with video output: - Oasis: three oases (Large Sparse, Medium Normal, Small Dense) on a desert map to observe how different food densities drive trait evolution - River: river with tributaries where food concentrates near water, testing if proximity to resources drives body size evolution Both examples include per-zone trait comparison charts (size, speed, awareness) and generate MP4 videos from rendered frames. Also fix a boundary clamp bug in Environment::updatePositionsInSpatialIndex where organisms at the map edge could land exactly on width/height, causing OutOfRangeException with the quadtree spatial index (half-open interval [0, size)). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
examples/oasis_video.py): three oases with different sizes/densities on a 5000x5000 desert map, 600 generations with per-zone trait comparisonexamples/river_video.py): river with tributaries on a 10000x10000 map, food concentrated near water, 800 generations with zone-based analysisEnvironment::updatePositionsInSpatialIndex— organisms at map edge could hit exact width/height, causingOutOfRangeExceptionwith quadtree spatial index (half-open interval[0, size))Test plan
cmake -S . -B build -DBUILD_TESTS=ON -DBUILD_BINDINGS=OFF && cmake --build build && cd build && ctest -Vpytestpython examples/oasis_video.py— generates video inoasis_output/python examples/river_video.py— generates video inriver_output/🤖 Generated with Claude Code