BinaryIndividual
Models & Types · AiDotNet.Genetics
Represents an individual encoded with binary genes, suitable for classic GA problems.
Implements: IEvolvable<BinaryGene, double>
Constructors
| Constructor | Summary |
|---|---|
BinaryIndividual(ICollection<BinaryGene> genes) |
Creates a binary individual with the specified genes. |
BinaryIndividual(int length, Random random) |
Creates a new binary individual with the specified chromosome length. |
Methods
| Method | Summary |
|---|---|
ICollection<BinaryGene> GetGenes() |
|
IEvolvable<BinaryGene, double> Clone() |
|
double GetFitness() |
|
double GetValueAsNormalizedDouble() |
Gets the binary value of this individual as a double in the range [0,1]. |
double GetValueMapped(double min, double max) |
Maps the binary string to a double value within the specified range. |
int GetValueAsInt() |
Gets the binary value of this individual as an integer. |
void SetFitness(double fitness) |
|
void SetGenes(ICollection<BinaryGene> genes) |