Provides a mapping for an entire sequence of genes in the chromosome of the population of the RSGeneticAlgorithm.TRSCustomGeneticAlgorithm component and its descendants. The TRSGAGenes collection maintains the list of all genes. The TRSCustomGeneticAlgorithm class contains a population of individuals ( RSGeneticAlgorithm.TRSGAPopulation ), which contain chromosomes (Bits property). These chromosomes are used to abstractly represent the solution to the search problem. They represent through their bits the DNA of each candidate solution (or individual), represented by a RSGeneticAlgorithm.TRSGAIndividual class. The chromosomes are created by taking the parameters or factors (integers, booleans, floats, and enumerations) of your search problem and concatenating them together into a sequence of bits. Each gene, RSGeneticAlgorithm.TRSGAGene , of the collection provides a mapping for a section of the chromosome. Each gene occupies a number of bits of the chromosome (based on their Size property). The Size property of the collection tracks the number of bits necessary for the entire chromosome.
Use the properties and methods of TRSGAGenes to:
• Access a specific gene.
• Add or delete genes from the list.
• Get or set the values of individual genes.
• Iterate through all genes.
• Read and write genes to XML.
Note |
---|
Genes are optional (instead, you can use the GeneSize property). These classes help you decode the bits of an individual but if you don't want to use them, you do not have to. If they are defined, the size of the chromosomes for every individual is the same. |
Namespace: RSGeneticAlgorithm
TOwnedCollection |
Delphi |
type |
|
|
Reference |