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); }
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); }
public PopulationSelector(int result, int eliteCount, StohasticGenerator stohasticGenerator) { this.eliteCount = eliteCount; this.result = result; this.stohasticGenerator = stohasticGenerator.Copy(); }