Hide Comments
Hide Comments

TRSGAGene.GeneAsFloat(TRSEncodedBits,Integer) Method

Comments (0)

Extracts this gene's value from the Bits chromosome parameter. The function allows read access to the gene as double floating-point values. The equivalent    SetGeneAsDouble method provides write access. The GeneAsFloat function will attempt to translate the chromosome bits of this gene to a single, 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.

Note: The TRSGAGene class automatically retrieves the appropriate value from the correct place in the Bits chromosome using the Offset and Size properties. The overloaded GeneAsDouble method will also automatically use the    Offset property.
 

Namespace: RSGeneticAlgorithm

expandingSyntax

Delphi

public 
  function GeneAsFloat(Bits: TRSEncodedBits; Offset: Integer): Single; overload; 
 

Parameters

Bits

Type: TRSEncodedBits

Offset

Type: Integer

Return Value

Type: Single

expandingSee Also

Comments (0)