Changeset 13285 for stable/HeuristicLab.Tests/HeuristicLab-3.3/Samples
- Timestamp:
- 11/19/15 11:56:45 (9 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13214,13217,13223-13224,13226,13228,13231-13232,13260
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 13223-13224,13226,13260
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab-3.3/Samples/SamplesUtils.cs
r11907 r13285 2 2 using System.Linq; 3 3 using System.Threading; 4 using HeuristicLab.Algorithms.ALPS; 4 5 using HeuristicLab.Algorithms.EvolutionStrategy; 5 6 using HeuristicLab.Algorithms.GeneticAlgorithm; … … 170 171 ga.Engine = new ParallelEngine.ParallelEngine(); 171 172 } 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 } 172 199 } 173 200 }
Note: See TracChangeset
for help on using the changeset viewer.