M11.1: environmental rules 3 with per-second rates (ADR-0099, segment 3)
Foundation / checks (deploy) (push) Successful in 3m27s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (client) (push) Successful in 12m20s
Foundation / checks (network) (push) Successful in 13m53s
Foundation / checks (tsan) (push) Successful in 8m9s
Foundation / checks (checks) (push) Successful in 33m4s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 21m43s
Foundation / checks (deploy) (push) Successful in 3m27s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (client) (push) Successful in 12m20s
Foundation / checks (network) (push) Successful in 13m53s
Foundation / checks (tsan) (push) Successful in 8m9s
Foundation / checks (checks) (push) Successful in 33m4s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 21m43s
Rules 3 is rules 2 with irradiance, growth, intake and decay per second. The community derives its per-tick form once at creation and restore (rationals exact via the tick in numerator and denominator, caps rounded down); steps and the snapshot layout are rules 2's; the codec reads formats 1-3. At 50 ms a x20 per-second twin steps identically through feeding, death and decay and across a snapshot; at 25 ms caps halve. Rules 1/2 and the development-v1 opening are unchanged. Development version 1 outputs stay tied to their 50 ms quantum and the tick-abstract M2 fixtures are not migrated (recorded). environmental-qualification's "unknown rules" case moves from 3 to 4. Refresh the dev session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
#pragma once
|
||||
#include "evo/world/transfers.hpp"
|
||||
#include <optional>
|
||||
namespace evo::processes {
|
||||
// Explicit fixture parameters; units and array order in environmental-community.md.
|
||||
// Rules 1 and 2 state rates per tick of `tick_microseconds`. Rules 3 (ADR-0099) is rules
|
||||
// 2 with every rate per second: irradiance and growth as rationals per second (converted
|
||||
// exactly), and intake and decay caps per second (rounded down at the tick).
|
||||
struct EnvironmentalConfig {
|
||||
std::uint64_t rules{1}, world{}, frame{}, producer{}, consumer{}, source{}, tick_microseconds{},
|
||||
area_um2{}, irradiance_numerator{}, irradiance_denominator{1}, efficiency{},
|
||||
@@ -9,7 +13,8 @@ struct EnvironmentalConfig {
|
||||
std::array<std::uint64_t, 5> recipe{}, intake{};
|
||||
std::uint64_t assimilation{}, producer_min_mK{}, producer_max_mK{}, consumer_min_mK{},
|
||||
consumer_max_mK{};
|
||||
std::array<std::uint64_t, 10> decay{}; // Rules 2: shared source-channel caps per tick.
|
||||
std::array<std::uint64_t, 10> decay{}; // Rules 2+: shared source-channel caps per tick
|
||||
// (rules 3: per second).
|
||||
auto operator<=>(const EnvironmentalConfig&) const = default;
|
||||
};
|
||||
struct EnvironmentalInput {
|
||||
@@ -89,11 +94,14 @@ class EnvironmentalCommunity {
|
||||
EnvironmentalCommunity() = default;
|
||||
[[nodiscard]] State state() const noexcept;
|
||||
[[nodiscard]] bool valid(const State& s) const noexcept;
|
||||
[[nodiscard]] static bool configuration(const EnvironmentalConfig& c,
|
||||
const world::EnvironmentalTransfers& r) noexcept;
|
||||
// Validates a configuration and returns its per-tick form (itself for rules 1 and 2;
|
||||
// rules 3's rates converted at its tick), or nothing when invalid.
|
||||
[[nodiscard]] static std::optional<EnvironmentalConfig>
|
||||
configuration(const EnvironmentalConfig& c, const world::EnvironmentalTransfers& r) noexcept;
|
||||
[[nodiscard]] std::expected<EnvironmentalReport, CommunityError>
|
||||
step(State& candidate, std::uint64_t tick, const EnvironmentalInput& input) const noexcept;
|
||||
EnvironmentalConfig config_{};
|
||||
EnvironmentalConfig config_{}; // As configured and persisted.
|
||||
EnvironmentalConfig step_{}; // Its per-tick form, which every step uses.
|
||||
std::unique_ptr<world::EnvironmentalTransfers> resources_;
|
||||
EnvironmentalProgress progress_{};
|
||||
State anchor_{};
|
||||
|
||||
Reference in New Issue
Block a user