Beispiel #1
0
        public void runEpochParallel()
        {
            Crossover();
            Mutate();
            if (!allowDupes)
            {
                replaceDuplicates();
            }
            TasksPool.waitAllTasks(); // selection needs the fitness already evaluated
            Selection();

            if (AutoShuffling)
            {
                Shuffle();
            }
        }
Beispiel #2
0
 public MultiThreadEvaluationPopulation(int size, T ancestor, IFitnessFunction fitnessFunction, ISelectionMethod selectionMethod, CustomThreadPool pool, bool allowDuplicateChromosomes)
     : base(size, fitnessFunction, selectionMethod)
 {
     TasksPool = pool;
     if (ancestor != null && size > 0)
     {
         AddChromosome(ancestor);
     }
     TasksPool.waitAllTasks(); // the first evaluation can't be parallel, due to gui input problems
     for (int s = 1; s < size; ++s)
     {
         AddChromosome(this[0].CreateNew());
     }
     allowDupes = allowDuplicateChromosomes;
 }