Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/15 11:56:45 (9 years ago)
Author:
ascheibe
Message:

#2269 merged r13214, r13217, r13223, r13224, r13226, r13228, r13231, r13232, r13260 into stable

Location:
stable
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Tests

  • stable/HeuristicLab.Tests/HeuristicLab-3.3/Samples/SamplesUtils.cs

    r11907 r13285  
    22using System.Linq;
    33using System.Threading;
     4using HeuristicLab.Algorithms.ALPS;
    45using HeuristicLab.Algorithms.EvolutionStrategy;
    56using HeuristicLab.Algorithms.GeneticAlgorithm;
     
    170171      ga.Engine = new ParallelEngine.ParallelEngine();
    171172    }
     173
     174    public static void ConfigureAlpsGeneticAlgorithmParameters<S, C, M>(AlpsGeneticAlgorithm ga, int numberOfLayers, int popSize, double mutationRate, int elites, bool plusSelection, AgingScheme agingScheme, int ageGap, double ageInheritance, int maxGens)
     175      where S : ISelector
     176      where C : ICrossover
     177      where M : IManipulator {
     178      ga.Seed.Value = 0;
     179      ga.SetSeedRandomly.Value = true;
     180
     181      ga.NumberOfLayers.Value = numberOfLayers;
     182      ga.PopulationSize.Value = popSize;
     183
     184      ga.Selector = ga.SelectorParameter.ValidValues.OfType<S>().Single();
     185      ga.Crossover = ga.CrossoverParameter.ValidValues.OfType<C>().Single();
     186      ga.Mutator = ga.MutatorParameter.ValidValues.OfType<M>().Single();
     187      ga.MutationProbability.Value = mutationRate;
     188      ga.Elites.Value = elites;
     189      ga.PlusSelection = plusSelection;
     190
     191      ga.AgingScheme = new EnumValue<AgingScheme>(agingScheme);
     192      ga.AgeGap.Value = ageGap;
     193      ga.AgeInheritance.Value = ageInheritance;
     194
     195      ga.MaximumGenerations = maxGens;
     196     
     197      ga.Engine = new ParallelEngine.ParallelEngine();
     198    }
    172199  }
    173200}
Note: See TracChangeset for help on using the changeset viewer.