Skip to content

Commit c03d758

Browse files
committed
Add RangeGenotype permutation options in doc
1 parent 1b01fa3 commit c03d758

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/genotype/range.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,16 @@ where
797797
writeln!(f, "genotype:")?;
798798
writeln!(f, " genes_size: {}", self.genes_size)?;
799799
writeln!(f, " mutation_type: {:?}", self.mutation_type)?;
800-
writeln!(f, " chromosome_permutations_size: uncountable")?;
800+
801+
if let Some(max_scale_index) = self.max_scale_index() {
802+
let sizes: Vec<BigUint> = (0..max_scale_index)
803+
.map(|scale_index| self.chromosome_permutations_size(Some(scale_index)))
804+
.collect();
805+
writeln!(f, " chromosome_permutations_size (per scale): {:?}", sizes)?;
806+
} else {
807+
writeln!(f, " chromosome_permutations_size: uncountable")?;
808+
}
809+
801810
writeln!(
802811
f,
803812
" neighbouring_population_size: {}",

src/strategy/permutate.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ pub enum PermutateVariant {
4141
/// issues, as the permutations are not instantiated at the same time, just iterated over. But it
4242
/// will take forever...
4343
///
44+
/// There is a method to permutate
45+
/// [RangeGenotype](crate::genotype::RangeGenotype) and
46+
/// [MultiRangeGenotype](crate::genotype::MultiRangeGenotype) chromosomes. Listed in
47+
/// descending priority:
48+
/// * With allele_mutation_scaled_range(s) set on genotype:
49+
/// * First scale (index = 0) traverses the whole allele_range(s) with the upper bound of the
50+
/// first scale as step size.
51+
/// * Other scales (index > 0) center around the best chromomsome of the previous scale,
52+
/// traversing the previous scale bounds around the best chromosome with the upper bound of the
53+
/// current scale as step size.
54+
/// * Scale down after grid is full traversed
55+
/// * With allele_mutation_range(s) set on genotype: Permutation not supported
56+
/// * With only allele_range(s) set on genotype: Permutation not supported
57+
///
4458
/// There are reporting hooks in the loop receiving the [PermutateState], which can by handled by an
4559
/// [StrategyReporter] (e.g. [PermutateReporterDuration], [PermutateReporterSimple]). But you are encouraged to
4660
/// roll your own, see [StrategyReporter].

0 commit comments

Comments
 (0)