Show/Hide Toolbars

RiverSoftAVG Products Help

Navigation: Code Documentation > GeneticAlgorithm > RSGeneticBase > Classes > TRSCustomGeneticComponent > Methods

TRSCustomGeneticComponent.CompareFitness(TRSIndividual,TRSIndividual,Boolean) Method

Scroll Prev Top Next More

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



Type: TRSIndividual


Type: TRSIndividual


Type: Boolean

Return Value

Type: Integer

RiverSoftAVG Products Help © 1996-2016 Thomas G. Grubb