Skip to content

feat: add oasis and river ecosystem simulation examples#27

Open
YJack0000 wants to merge 1 commit into
mainfrom
feat/simulation-examples
Open

feat: add oasis and river ecosystem simulation examples#27
YJack0000 wants to merge 1 commit into
mainfrom
feat/simulation-examples

Conversation

@YJack0000

Copy link
Copy Markdown
Owner

Summary

  • Add oasis simulation (examples/oasis_video.py): three oases with different sizes/densities on a 5000x5000 desert map, 600 generations with per-zone trait comparison
  • Add river simulation (examples/river_video.py): river with tributaries on a 10000x10000 map, food concentrated near water, 800 generations with zone-based analysis
  • Fix boundary clamp bug in Environment::updatePositionsInSpatialIndex — organisms at map edge could hit exact width/height, causing OutOfRangeException with 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 -V
  • pytest
  • python examples/oasis_video.py — generates video in oasis_output/
  • python examples/river_video.py — generates video in river_output/

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant