Hide Comments
Hide Comments

TRSCustomGeneticComponent.CompareFitness(TRSIndividual,TRSIndividual,Boolean) Method

Comments (0)

Compares the two individuals and returns an evaluation of who is fitter. If the result is -1, Parent1 is fitter. If the result is 1, Parent2 is fitter. If the two individuals are equally fit, the function returns 0.

The function uses the RSGeneticBase.TRSIndividual.Fitness property or RSGeneticBase.TRSIndividual.WeightedFitness to determine which parent is fitter. The    FitnessMethod controls the interpretation of the fitness.

The UsePureFitness parameter tells the function if it should ignore WeightedFitness or not.

Namespace: RSGeneticBase

expandingSyntax

Delphi

public
  function CompareFitness( const Parent1, Parent2: TRSIndividual; UsePureFitness: Boolean = False ): Integer;
 

Parameters

Parent1

Type: TRSIndividual

Parent2

Type: TRSIndividual

UsePureFitness

Type: Boolean

Return Value

Type: Integer

expandingSee Also

Comments (0)