Skip to main content

rlevo_evolution/
lib.rs

1//! Tensor-native classical evolutionary algorithms for `rlevo`.
2//!
3//! This crate ships the classical EA families — Genetic Algorithm (GA),
4//! Evolution Strategy (ES), Evolutionary Programming (EP), Differential
5//! Evolution (DE), and Cartesian Genetic Programming (CGP) — on top of the
6//! Burn tensor abstraction, with GPU acceleration via custom `CubeCL` kernels
7//! on hot paths.
8//!
9//! # Surface area
10//!
11//! - [`strategy`] — the central [`Strategy`] trait and
12//!   the [`EvolutionaryHarness`] adapter that
13//!   wraps any strategy into `rlevo-core::evaluation::BenchEnv`.
14//! - [`genome`] — zero-sized marker types (`Real`, `Binary`, `Integer`,
15//!   `Tree`, `Permutation`) that parameterize the operator set.
16//! - [`population`] — [`Population<B, K>`](population::Population), a thin
17//!   wrapper around `Tensor<B, 2>` carrying shape metadata.
18//! - [`fitness`] — [`FitnessFn`](fitness::FitnessFn) /
19//!   [`BatchFitnessFn`](fitness::BatchFitnessFn), the
20//!   [`FromFitnessEvaluable`](fitness::FromFitnessEvaluable) adapter for
21//!   `rlevo-core::fitness::FitnessEvaluable`, and the
22//!   [`FromLandscape`](fitness::FromLandscape) adapter for landscapes that
23//!   carry their own `evaluate` method.
24//! - [`observer`] — [`PopulationObserver`] /
25//!   [`PopulationSnapshot`] /
26//!   [`SharedPopulationObserver`]:
27//!   structured per-generation callback for recorders that need more than
28//!   the scalar `tracing` events (full fitness vector, best-individual
29//!   index, lineage).
30//! - [`rng`] — deterministic seed streams (splitmix64) for reproducibility.
31//! - [`shaping`] — fitness shaping transforms (centered rank, z-score).
32//! - [`ops`] — selection, crossover, mutation, and replacement operators.
33//! - [`algorithms`] — concrete strategies.
34
35pub mod algorithms;
36pub mod fitness;
37pub mod genome;
38pub mod observer;
39pub mod ops;
40pub mod population;
41pub mod rng;
42pub mod shaping;
43pub mod strategy;
44
45pub use observer::{PopulationObserver, PopulationSnapshot, SharedPopulationObserver};
46pub use strategy::{EvolutionaryHarness, Strategy, StrategyMetrics};