Hide Comments
Hide Comments

Comments (0)

Specifies the Fitness level desired for the evolutionary search. If the    FittestIndividual of the    Population has a fitness greater than or less than (depending on the    FitnessMethod) the fitness cutoff, the    Evolve method will abort evolution.

Note the    UseFitnessCutoff property must be True to use the fitness cutoff.
 
 

Namespace: RSGeneticBase

expandingSyntax

Delphi

public
  property FitnessCutoff: TGAFitness read FFitnessCutoff write SetFitnessCutoff stored IsFitnessCutoffStored;
 

Property Value

Type: TGAFitness

expandingExamples

The following example uses Diversity, Generation and Fitness to automatically stop evolution:

Delphi

var
    i: Integer;
 begin
      // evolve population for number of generations, until diversity is too
      // low, or best individual meets fitness cutoff and
      // return number of generations executed
      result := Generation;
      for i := 0 to Generations - 1 do
      begin
           Evolve;
           if (UseFitnessCutoff and
               (((FitnessMethod in [fmMaximize, fmWeightedMaximize]) and (FittestIndividual.Fitness >= FitnessCutoff)) or
               ((FitnessMethod in [fmMinimize, fmWeightedMinimize]) and (FittestIndividual.Fitness <= FitnessCutoff)))) or
              (UseDiversityLimit and (Diversity < DiversityLimit)) or
              (UseGenerationLimit and (Generation >= GenerationLimit)) then Break;
      end;
      result := Generation - result;
 end;

expandingSee Also

Comments (0)