Skip to content

EngineParameters Class

Greg Sommerville edited this page Aug 21, 2018 · 18 revisions

EngineParameters

A class containing configuration information for the genetic engine. An object of this type is passed into the constructor of the engine.

Fields

Name Data Type Description Typical Value Default Value
PopulationSize int The number of candidate solutions in a generation depends on the problem, maybe 200 - 1000 200
IsLowerFitnessBetter bool Indicates if a lower fitness score is desired depends on the problem true
SelectionStyle enum Tourney has the fastest performance but is more random (meaning, a lucky candidate with a bad fitness score can be easily selected), although that can be adjusted by increasing the TourneySize parameter.

RouletteWheel is fitness-proportionate, but has slower performance.

Ranked adjusts the fitness scores from their raw values into a ranking (to help smooth out situations where one candidate may be vastly better than others), and then uses Roulette Wheel to do the selection.
your choice Tourney
TourneySize int When SelectionStyle is Tourney, specifies the number of candidates to randomly select, using the best of those 3 - 10, depends on population and how much you want to lean towards good candidates 4
CrossoverRate double A number from 0 to 1 that indicates how often crossover should happen. If crossover doesn't happen, the parent candidates are simply passed unaltered into the next generation 0.95, but it could be 1.0 if you're using elitism, which does roughly the same thing 0.95
MutationRate double Chance (from 0 to 1.0) that a candidate solution will be mutated, per generation 0 - 0.2 0.01
ElitismRate double A number from 0 to 1.0 that indicates what percentage (expressed as a decimal) of the population (sorted by fitness) should be passed unaltered into the next generation 0.05 - 0.20 0.10
RandomTreeMinDepth int When creating a random expression tree for generation 0 or mutation, the minimum tree depth desired 4 - 6 4
RandomTreeMaxDepth int When creating a random expression tree for generation 0 or mutation, the maximum tree depth desired 6 - 12 7
MinGenerations int The minimum number of generations to process, unless terminated by user 20 - 30 25
MaxGenerations int The maximum number of generations to process, unless terminated by user 50 - 100 75
StagnantGenerationLimit int How many generations to process without an increase in average fitness, before terminating 2 or 3 for quick tests, 10+ once you want the best solutions 12

Clone this wiki locally