
Constructors
Name | Description | |
---|---|---|
![]() | GeneticAlgorithm |
Initializes a new instance of the GeneticAlgorithm class.
|
![]() | GeneticAlgorithm(String) |
Initializes a new instance of the GeneticAlgorithm class.
|
Methods
Name | Description | |
---|---|---|
![]() | Add |
Adds the specified Genome. All Genomes must contain exactly the same number and
type of chromosomes and genes and must be added in the same order for each genome.
The initial population of genomes must contain multiple xy genome pairs with
different surnames to prevent inbreeding, which would cause a lack of variation.
|
![]() | CreateGenomes |
Overridable function creates the population of Genomes.
|
![]() | ![]() | (Inherited from ![]() |
![]() | Evaluate |
Evaluates the specified genome using a client-supplied custom fitness function.
|
![]() | Evolve |
Evolves the genomes based on the error summation caused by the genes in each chromosome.
Unlike other algorithms, this version evolves based on the fitness of the entire genome.
This function should be called once after each evaluation of the genomes.
The stop condition may be when the error reaches a pre-defined optimum, or after a
certain number of iterations without any improvement, or a combination thereof.
|
![]() | ![]() | Allows an (Inherited from ![]() ![]() ![]() |
![]() | FittestGenomes |
Returns the top n fittest genomes.
|
![]() ![]() | FromString |
Creates a new GeneticAlgorithm object from a string created by ToString.
|
![]() | ![]() | Serves as a hash function for a particular type. (Inherited from ![]() |
![]() | ![]() | Gets the (Inherited from ![]() ![]() |
![]() ![]() | Load |
Loads the specified genetic algorithm from a file.
|
![]() | ![]() | Creates a shallow copy of the current (Inherited from ![]() ![]() |
![]() | Mutate |
Ages the individual by performing mutations.
|
![]() | Run |
Code goes here to loop through and run the GA
|
![]() | Save |
Saves this genetic algorithm to a file.
|
![]() | ToString |
Returns a (Overrides ![]() ![]() |
Properties
Name | Description | |
---|---|---|
![]() | Archive |
Determines if dead genomes should be stored
|
![]() | Genomes |
Entire population of Genomes (individuals).
|
![]() | InbreedingDistance |
Distance in ordinal position between two genomes to prevent interbreeding.
Based on Westermarck. The greater the value, the more females must be added
in the beginning to exceed the limit.
|
![]() | PopulationSize |
The maximum size of the genome population.
The recommended size is 1,000 or greater.
|
![]() | Stop |
Instructs the Evolve function to stop.
|
![]() | Tag |
Helps identify the the genetic algorithm.
|
Events
Name | Description | |
---|---|---|
![]() | OnBirth |
Fires when a new genome is created.
|
![]() | OnDeath |
Fires when a genome is removed from the population.
|
![]() | OnGenomeSelectionFailed |
Fires when a genome could not be selected in the Evolve method.
This occurs when the initial population is too small or the
InbreedingDistance property is set too high in
relation to the population size.
|
![]() | OnGenomeUpdated |
Fires when a genome has been updated, either through
creation or mutation.
|
See Also