Expand description
Central Strategy trait and the EvolutionaryHarness adapter.
§The ask / tell contract
A Strategy exposes three methods that together drive one
generation:
init— build the initial state (sampling the population, initializing σ, generation counter, etc).ask— propose the next population as a genome container.tell— consume that population together with its fitness and produce the next state plus a metrics snapshot.
All three methods take the RNG explicitly so the harness owns all stochasticity; strategies carry no internal PRNG state.
§Fitness convention
The fitness tensor passed to tell is the raw
objective value. Strategies in this crate minimize it: the
StrategyMetrics::best_fitness field is the smallest value observed
so far, and the harness reports reward = -best_fitness so the
benchmark harness’s “higher = better” convention still holds.
§The harness adapter
EvolutionaryHarness glues a strategy to any
BatchFitnessFn and implements
BenchEnv, so the benchmark
evaluator drives it just like an RL environment.
Structs§
- Evolutionary
Harness - Wraps a
Strategyinto aBenchEnvso the benchmark harness can drive it. - Strategy
Metrics - Per-generation summary reported by
Strategy::tell.
Traits§
- Strategy
- Central evolutionary-strategy abstraction.