@@ -14,43 +14,53 @@ centralized `DynamicMatrixGenotype` and `StaticMatrixGenotype` with all their
1414added centralized complexity (` ChromosomeManager ` and ` GenesPointer ` v. ` GenesOwner `
1515etc...).
1616
17- The first attempt was to split the library in two: centralized v.
18- distributed, where the distributed track could become less ` Genotype ` -heavy and more
19- flexible. But it also happens the GPU optimization premise was flawed as memory
20- transfers are required regardless of pre-transfer layout. So on the end we just
21- dropped the whole centralized approach and archived it in
22- [ archive/centralized-gpu-experiment branch] ( https://github.com/basvanwesting/genetic-algorithm/tree/archive/centralized-gpu-experiment ) .
17+ The first attempt was to split the library in two: centralized v. distributed,
18+ where the distributed track could become less genotype-heavy and more
19+ flexible. But it also happens the GPU zero-copy optimization premise was flawed
20+ as memory transfers are required regardless of pre-transfer layout. So on the
21+ end we just dropped the whole centralized approach and archived it in
22+ [ archive/centralized-gpu-experiment branch] ( https://github.com/basvanwesting/genetic-algorithm/tree/archive/centralized-gpu-experiment )
23+ for later use, when zero-copy actually becomes viable.
2324
2425Now the library is restructured to a simpler form, moving a lot of
2526responsibilities away from ` Genotype ` which was becoming too heavy and
26- centralized: All genes are now ` Vec<Allele> ` and stored on the ` Chromosome ` .
27- Chromosome recycling has been moved from the ` Genotype ` (` ChromosomeManager ` ) to the
28- ` Population ` .
27+ centralized: All genes are now ` Vec<Allele> ` and stored on the ` Chromosome `
28+ (which now only has one implementation, no genotype specific variants anymore).
29+ Chromosome recycling has been moved from the ` Genotype ` (` ChromosomeManager ` )
30+ to the ` Population ` .
2931
30- Still ` Genotype ` unification proved impossible - each type has fundamentally
32+ However, ` Genotype ` unification proved impossible - each type has fundamentally
3133different requirements. So the best route to allow for easier custom ` Mutate `
3234and ` Crossover ` implementations, was to make them user-genotype specific using
3335an associated type ` Genotype ` on ` Mutate ` and ` Crossover ` traits (following
34- existing ` Fitness ` pattern).
36+ existing ` Fitness ` pattern). The Genotypes now also have some
37+ implementation-specific helper methods to support custom implementations:
38+ ` sample_allele() ` , ` sample_gene_delta() ` , ` sample_gene_index() ` ,
39+ ` sample_gene_indices() ` .
40+
41+ Skip the associated type ` Genotype ` on ` Select ` and ` Extension ` for now, as
42+ these mainly work with the chromosome metadata and are not genotype specific.
3543
3644General usage by client is hardly impacted, most is internal.
3745
3846### Changed
3947* Add associated type ` Genotype ` to ` Mutate ` and ` Crossover ` traits (following
40- existing ` Fitness ` pattern). Skip the associated type ` Genotype ` on ` Select `
41- and ` Extension ` for now, as mainly work with the chromosome-meta data and are
42- not Genotype specific.
48+ existing ` Fitness ` pattern).
4349* Move chromosome recycling from ` ChromosomeManager ` to ` Population `
4450* Move genes hashing from the ` Genotype ` to ` Chromosome ` making the ` Allele `
45- trait responsible for the hashing implementation
46- * Moved ` current_scale_index ` from ` StrategyState ` to ` Genotype `
51+ trait responsible for the hashing implementation (with ` impl_allele! ` macro
52+ for default implementation)
53+ * Moved ` current_scale_index ` from ` StrategyState ` to ` Genotype ` . This is the
54+ only change towards ` Genotype ` . The scaling is only implemented by
55+ ` RangeGenotype ` and ` MultiRangeGenotype ` , so it felt more genotype specific.
56+ It does make the ` Genotype ` mutable again, which is an accepted tradeoff.
4757
4858### Removed
4959* Remove matrix genotypes (` DynamicMatrixGenotype ` , ` StaticMatrixGenotype ` )
5060* Remove ` ChromosomeManager ` trait
5161* Remove ` BitGenotype ` - use ` BinaryGenotype ` with ` Vec<bool> ` instead
52- * Remove population-level fitness calculation ( ` calculate_for_population() ` ),
53- all is now ` calculate_for_chromosome() `
62+ * Remove ` calculate_for_population() ` as the population-level fitness calculation user
63+ hook. All is now ` calculate_for_chromosome() `
5464
5565## [ 0.20.5] - 2025-05-21
5666### Added
0 commit comments