示例#1
0
 public Genotype(GeneticAlgorithmSettings settings)
 {
     Rng           = settings.Rng;
     Value         = new bool[settings.GenotypeLength];
     MutationRate  = 1.0 / settings.GenotypeLength;
     CrossoverRate = settings.CrossoverRate;
 }
示例#2
0
 public GeneticAlgorithm(GeneticAlgorithmSettings settings)
 {
     Settings      = settings;
     ThePopulation = new Population(settings);
     ThePopulation.Initialize();
     ThePopulation.Randomize();
     StopFunction = settings.StopFunction;
     Logger       = settings.Logger;
 }
示例#3
0
 public Population(GeneticAlgorithmSettings settings)
 {
     Settings                  = settings;
     FitnessFunction           = settings.FitnessFunction;
     FittestSelectionAlgorithm = settings.FittestSelectionAlgorithm;
     Rng = settings.Rng;
     Initialize();
     Randomize();
 }