示例#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);
 }
示例#2
0
        public GeneticAlgorithm(GeneticAlgorithmConfiguration configuration)
        {
            CrossoverProbability = configuration.CrossoverProbability;
            SurvivalProbability  = configuration.SurvivalProbability;
            MutationProbability  = configuration.MutationProbability;
            PopulationSize       = configuration.PopulationSize;
            MaxStep        = configuration.MaxStep;
            GroupSize      = configuration.GroupSize;
            GenotypeLength = configuration.PeopleNumber;

            configuration.Delegate = this;
        }
示例#3
0
 public void Refresh(GeneticAlgorithmConfiguration geneticAlgorithmConfiguration)
 {
     GenotypeLength = geneticAlgorithmConfiguration.PeopleNumber;
 }