예제 #1
0
 public ECOptimizationTest(
     string id, IECTestsConfig testsConfig, IECChromosome ancestor, FitnessFunction fitnessFunction)
     : base(id, testsConfig)
 {
     this.population = new ECPopulation(testsConfig, ancestor, fitnessFunction);
     this.RandomProportionProgress = new StatisticalQuantity(testsConfig.MaxIterations);
 }
예제 #2
0
        public ECPopulation(
            IECTestsConfig testsConfig, IECChromosome ancestor, FitnessFunction fitnessFunction) :
            base(testsConfig.NumTestsPerIteration, ancestor, fitnessFunction, testsConfig.SelectionMethod)
        {
            this.testsConfig = testsConfig;

            //sets population ref to all chromosomes
            ancestor.Population = this;
            for (var i = 0; i < this.Size; i++)
            {
                ((IECChromosome)this[i]).Population = this;
            }

            //default values
            this.CrossoverRate          = DEFAULT_CROSSOVER_RATE;
            this.MutationRate           = DEFAULT_MUTATION_RATE;
            this.RandomSelectionPortion = testsConfig.RandomSelectionPortion;
        }