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
//! Binary chromosome initializer.
//!
//! Creates random binary (true/false) genes for [`chromosomes::Binary`](crate::chromosomes::Binary)
//! chromosomes.
use crateBinary as BinaryGenotype;
use Rng;
/// Initializes a vector of `Binary` genes with random values.
///
/// # Arguments
///
/// * `genes_per_chromosome` - The number of genes per chromosome.
/// * `_alleles` - An optional slice of `Binary` to use as a source of alleles (not used in this function).
/// * `_needs_unique_ids` - An optional boolean indicating if unique IDs are needed (not used in this function).
///
/// # Returns
///
/// A vector of `Binary` genes with random values.
///
/// # Examples
///
/// ```
/// use genetic_algorithms::chromosomes::Binary;
/// use genetic_algorithms::initializers::binary_random_initialization;
///
/// let genes = binary_random_initialization(100, None, None);
/// assert_eq!(genes.len(), 100);
/// ```