1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Traits — core abstraction contracts for the genetic algorithm framework.
//!
//! Defines the trait interfaces that all chromosomes, genes, operators, and
//! configurations must implement. Every public type in the library derives its
//! behavior from one or more of these trait contracts, enabling full genericity
//! over chromosome and gene types.
//!
//! This module re-exports all public traits from its sub-modules:
//!
//! - [`GeneT`] — the gene abstraction (identity, cloning).
//! - [`ChromosomeT`] — the minimal chromosome evaluation contract (fitness, age).
//! - [`LinearChromosome`] — the flat-slice chromosome contract (DNA, set_gene, reset).
//! - [`ConfigurationT`] and its sub-traits — builder-pattern configuration.
//! - Operator traits ([`SelectionOperator`], [`CrossoverOperator`],
//! [`MutationOperator`], [`SurvivorOperator`]) — for custom operator
//! implementations.
//! - Helper functions and type aliases ([`FitnessFn`], [`InitializationFn`]).
//!
//! # Key items
//!
//! | Item | Description |
//! |------|-------------|
//! | [`GeneT`] | Minimal gene trait: identity, default, comparison |
//! | [`ChromosomeT`] | Minimal evaluation contract: fitness, age, calculate_fitness |
//! | [`LinearChromosome`] | Flat-slice contract: dna, set_dna, set_fitness_fn, set_gene, reset |
//! | [`ConfigurationT`] | Fluent builder trait for configuring engines |
//! | [`SelectionOperator`] | Trait for custom selection implementations |
//! | [`CrossoverOperator`] | Trait for custom crossover implementations |
//! | [`MutationOperator`] | Trait for custom mutation implementations |
//! | [`SurvivorOperator`] | Trait for custom survivor selection implementations |
//! | [`Strategy`] | Common interface for runtime algorithm swapping via `Box<dyn Strategy<U>>` |
//!
//! # When to use
//! Implement these traits when creating custom chromosome types, gene types,
//! or operator strategies. See the [`chromosomes`](crate::chromosomes), [`genotypes`](crate::genotypes), and
//! [`operations`](crate::operations) modules for built-in implementations.
pub use Strategy;
pub use ChromosomeT;
pub use ;
pub use ;
pub use GeneT;
pub use GroupAware;
pub use LinearChromosome;
pub use MultiCaseFitness;
pub use OperatorCompat;
pub use ;
pub use RealGene;
pub use RealValued;
pub use RealValuedMutation;
pub use SelfAdaptive;
pub use VectorFitness;