Drive the energy cycle with measured ecosystem episodes
Close M2 with a deterministic driver that owns one community and one seeded stream, holds no inventory and emits only the terminal, feeding and reproduction intents the earlier increments already accept. No simulation contract changed to make the cycle run unattended. Two limits shaped the design. Identities are never reused and slots are capped, so one community supports a bounded number of consumer lifetimes and is not a population. No maintenance cost exists, so a consumer that is never eaten never dies, and inventing a starvation rule here would settle a question ENERGY_MODEL leaves open inside a measurement harness. The harness therefore measures many bounded episodes, taking mortality from predation and from a configured lifespan delivered as an ADR-0027 host terminal fact. Lifespan bounds an episode; it is not senescence. The driver must never submit a batch the community rejects, so it probes a discarded copy each tick to size bites against the state feeding will actually see, claims each target for one feeder, and excludes a bitten consumer from acting. A rejected tick is reported as a driver defect rather than absorbed as ecology. Across 64 seeds the suite steps tick by tick, requiring exact conserved totals at every tick and an identical report on replay, and covers both mortality paths, slot exhaustion, tick-limit termination, lineage attribution, episode independence and configuration rejection. evo-sim --ecosystem reports seeded ensembles: 3,000 episodes advanced 1,093,007 ticks, all reaching extinction, with deaths reconciling exactly against founders plus births. That demonstrates arithmetic and turnover, not ecological plausibility; strategy constants are chosen inputs. Native Release, clang-tidy analysis, ASan and format checks pass 11/11; golden d61ad5bf0c928c76 is unchanged. Linux CI has not run yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+12
-2
@@ -40,13 +40,13 @@ target_include_directories(evo_accounting PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/in
|
||||
target_compile_features(evo_accounting PUBLIC cxx_std_23)
|
||||
evo_owned_target(evo_accounting)
|
||||
|
||||
add_library(evo_processes STATIC src/processes/producer.cpp src/processes/feeding.cpp)
|
||||
add_library(evo_processes STATIC src/processes/producer.cpp src/processes/feeding.cpp src/processes/ecosystem.cpp)
|
||||
add_library(evo::processes ALIAS evo_processes)
|
||||
target_link_libraries(evo_processes PUBLIC evo::accounting)
|
||||
evo_owned_target(evo_processes)
|
||||
|
||||
add_executable(evo-sim apps/evo-sim/main.cpp)
|
||||
target_link_libraries(evo-sim PRIVATE evo::simulation)
|
||||
target_link_libraries(evo-sim PRIVATE evo::simulation evo::processes)
|
||||
evo_owned_target(evo-sim)
|
||||
|
||||
include(CTest)
|
||||
@@ -56,6 +56,11 @@ if(BUILD_TESTING)
|
||||
evo_owned_target(evo-feeding-tests)
|
||||
add_test(NAME feeding-contracts COMMAND evo-feeding-tests)
|
||||
set_tests_properties(feeding-contracts PROPERTIES TIMEOUT 60)
|
||||
add_executable(evo-ecosystem-tests tests/ecosystem_tests.cpp)
|
||||
target_link_libraries(evo-ecosystem-tests PRIVATE evo::processes)
|
||||
evo_owned_target(evo-ecosystem-tests)
|
||||
add_test(NAME ecosystem-contracts COMMAND evo-ecosystem-tests)
|
||||
set_tests_properties(ecosystem-contracts PROPERTIES TIMEOUT 300)
|
||||
add_executable(evo-producer-tests tests/producer_tests.cpp)
|
||||
target_link_libraries(evo-producer-tests PRIVATE evo::processes)
|
||||
evo_owned_target(evo-producer-tests)
|
||||
@@ -76,6 +81,11 @@ if(BUILD_TESTING)
|
||||
set_tests_properties(cli-replay PROPERTIES PASS_REGULAR_EXPRESSION "d61ad5bf0c928c76")
|
||||
add_test(NAME cli-invalid-number COMMAND evo-sim --ticks -1)
|
||||
set_tests_properties(cli-invalid-number PROPERTIES WILL_FAIL TRUE)
|
||||
add_test(NAME cli-ecosystem COMMAND evo-sim --ecosystem --seed 0 --episodes 32)
|
||||
set_tests_properties(cli-ecosystem PROPERTIES TIMEOUT 120
|
||||
PASS_REGULAR_EXPRESSION "2cd4a15f9fbe9949")
|
||||
add_test(NAME cli-ecosystem-conflict COMMAND evo-sim --ecosystem --verify-replay)
|
||||
set_tests_properties(cli-ecosystem-conflict PROPERTIES WILL_FAIL TRUE)
|
||||
add_test(NAME cli-file-integration COMMAND "${CMAKE_COMMAND}"
|
||||
"-DEVO_SIM=$<TARGET_FILE:evo-sim>" "-DTEST_DIR=${CMAKE_CURRENT_BINARY_DIR}/cli-integration"
|
||||
-P "${CMAKE_CURRENT_SOURCE_DIR}/tests/cli_integration.cmake")
|
||||
|
||||
Reference in New Issue
Block a user