Skip to main content

Module observer

Module observer 

Source
Expand description

Per-generation observer surface for EvolutionaryHarness.

The harness emits a scalar tracing event per generation (best_fitness, mean_fitness, …) which feeds the on-disk metric stream. Population-level reporting — the full fitness vector, the best-individual digest, parent lineage — does not fit through tracing::info! cleanly: events are string-keyed and scalar-valued. PopulationObserver is the structured callback the EA-population recorder (rlevo_benchmarks::record::PopulationReporter) attaches to to capture that shape.

The trait is intentionally narrow — the snapshot fields mirror the report-tier PopulationSample schema 1:1 minus the inner_rl_returns field, which is the hybrid driver’s responsibility.

Structs§

PopulationSnapshot
Per-generation population snapshot delivered to a PopulationObserver.

Traits§

PopulationObserver
Callback the harness invokes once per generation, after Strategy::tell has returned and the canonical tracing::info! aggregate event has been emitted.

Type Aliases§

SharedPopulationObserver
Shared handle to a PopulationObserver. Backed by parking_lot::Mutex so the observer handle and the recording-tier sinks in rlevo-benchmarks share one lock type (ADR 0010); aliased so call sites do not have to spell out the Arc<Mutex<…>> shape every time.