Example #1
0
 public GeneticAlgorithmExecutor(GeneticAlgorithmConfiguration configuration, CancellationToken cancellationToken, SemaphoreSlim pauseSemaphore)
 {
     this.configuration     = configuration;
     this.cancellationToken = cancellationToken;
     this.pauseSemaphore    = pauseSemaphore;
     stohasticGenerator     = new StohasticGenerator(configuration.Operands);
     populationSelector     = new PopulationSelector(configuration.Result, configuration.EliteCount, stohasticGenerator);
 }
Example #2
0
 public EvolutionPhase(int result, int eliteCount, double mutationProbability, double crossoverProbability, int populationSize, StohasticGenerator stohasticGenerator)
 {
     this.mutationProbability  = mutationProbability;
     this.crossoverProbability = crossoverProbability;
     this.stohasticGenerator   = stohasticGenerator;
     this.populationSize       = populationSize;
     this.eliteCount           = eliteCount;
     this.populationSelector   = new PopulationSelector(result, eliteCount, stohasticGenerator);
 }