Provides access to this gene's value from the chromosome of the indexed individual ( RSGeneticAlgorithm.TRSGAIndividual ) in the genetic Population. The property allows read and write access to the gene as double precision floating point values. The AsDouble access property will attempt to translate the chromosome bits of this gene to a double, irregardless of the type specified in GeneType. In other words, the gene does not enforce types, it just helps you to translate bits into a type. You should use the GeneType property to determine the type of the gene before using the accessor functions.
Index specifies the position of the individual in the Population, from 0 to Population.Count - 1.
Note: The TRSGAGene class automatically stores and retrieves the appropriate value from the correct place in the RSGeneticAlgorithm.TRSGAIndividual.Bits chromosome using the
Offset and
Size properties.
Namespace: RSGeneticAlgorithm
Delphi |
public |
Parameters
Index
Type: Integer
Type: Double
To access the specific gene values for an individual in the population, you use the accessor properties (AsBoolean, AsInteger, etc) and index the values by the index for the individual in the population. To sum all integer genes for every individual, you would do the following: Delphi |
var |
Reference |