Property | Type | Description | |
---|---|---|---|
chromosomeGenerator | IRandomNumberGenerator |
||
mutationAdditionGenerator | IRandomNumberGenerator |
||
mutationMultiplierGenerator | IRandomNumberGenerator |
||
val | double[] |
Method | Description | |
---|---|---|
Clone ( ) : IChromosome |
Clone the chromosome. The method clones the chromosome returning the exact copy of it. |
|
CreateNew ( ) : IChromosome |
Create new random chromosome with same parameters (factory method). The method creates new chromosome of the same type, but randomly initialized. The method is useful as factory method for those classes, which work with chromosome's interface, but not with particular chromosome type. |
|
Crossover ( IChromosome pair ) : void |
Crossover operator. The method performs crossover between two chromosomes, selecting randomly the exact type of crossover to perform, which depends on CrossoverBalancer. Before crossover is done a random number is generated in [0, 1] range - if the random number is smaller than CrossoverBalancer, then the first crossover type is used, otherwise second type is used. The first crossover type is based on interchanging range of genes (array elements) between these chromosomes and is known as one point crossover. A crossover point is selected randomly and chromosomes interchange genes, which start from the selected point. The second crossover type is aimed to produce one child, which genes' values are between corresponding genes of parents, and another child, which genes' values are outside of the range formed by corresponding genes of parents. Let take, for example, two genes with 1.0 and 3.0 valueû (of course chromosomes have more genes, but for simplicity lets think about one). First of all we randomly choose a factor in the [0, 1] range, let's take 0.4. Then, for each pair of genes (we have one pair) we calculate difference value, which is 2.0 in our case. In the result we’ll have two children – one between and one outside of the range formed by parents genes' values. We may have 1.8 and 3.8 children, or we may have 0.2 and 2.2 children. As we can see we add/subtract (chosen randomly) difference * factor. So, this gives us exploration in between and in near outside. The randomly chosen factor is applied to all genes of the chromosomes participating in crossover. |
|
DoubleArrayChromosome ( |
Initializes a new instance of the DoubleArrayChromosome class. This is a copy constructor, which creates the exact copy of specified chromosome. |
|
DoubleArrayChromosome ( IRandomNumberGenerator |
Initializes a new instance of the DoubleArrayChromosome class. The constructor initializes the new chromosome with specified |
|
DoubleArrayChromosome ( IRandomNumberGenerator |
Initializes a new instance of the DoubleArrayChromosome class. The constructor initializes the new chromosome randomly by calling Generate method. |
|
Generate ( ) : void |
Generate random chromosome value. Regenerates chromosome's value using random number generator. |
|
Mutate ( ) : void |
Mutation operator. The method performs chromosome's mutation, adding random number to chromosome's gene or multiplying the gene by random number. These random numbers are generated with help of The exact type of mutation applied to the particular gene is selected randomly each time and depends on MutationBalancer. Before mutation is done a random number is generated in [0, 1] range - if the random number is smaller than MutationBalancer, then multiplication mutation is done, otherwise addition mutation. |
|
ToString ( ) : string |
Get string representation of the chromosome.
|
public Crossover ( IChromosome pair ) : void | ||
pair | IChromosome | Pair chromosome to crossover with. |
return | void |
public DoubleArrayChromosome ( |
||
source | Source chromosome to copy. | |
return | System |
public DoubleArrayChromosome ( IRandomNumberGenerator |
||
chromosomeGenerator | IRandomNumberGenerator |
Chromosome generator - random number generator, which is
/// used to initialize chromosome's genes, which is done by calling |
mutationMultiplierGenerator | IRandomNumberGenerator |
Mutation multiplier generator - random number /// generator, which is used to generate random multiplier values, which are used to /// multiply chromosome's genes during mutation. |
mutationAdditionGenerator | IRandomNumberGenerator |
Mutation addition generator - random number /// generator, which is used to generate random addition values, which are used to /// add to chromosome's genes during mutation. |
values | double | Values used to initialize the chromosome. |
return | System |
public DoubleArrayChromosome ( IRandomNumberGenerator |
||
chromosomeGenerator | IRandomNumberGenerator |
Chromosome generator - random number generator, which is
/// used to initialize chromosome's genes, which is done by calling |
mutationMultiplierGenerator | IRandomNumberGenerator |
Mutation multiplier generator - random number /// generator, which is used to generate random multiplier values, which are used to /// multiply chromosome's genes during mutation. |
mutationAdditionGenerator | IRandomNumberGenerator |
Mutation addition generator - random number /// generator, which is used to generate random addition values, which are used to /// add to chromosome's genes during mutation. |
length | int | Chromosome's length in array elements, [2, |
return | System |
protected IRandomNumberGenerator |
||
return | IRandomNumberGenerator |
protected IRandomNumberGenerator |
||
return | IRandomNumberGenerator |
protected IRandomNumberGenerator |
||
return | IRandomNumberGenerator |