Changeset 13293 for stable/HeuristicLab.Tests/HeuristicLab-3.3/Samples
- Timestamp:
- 11/19/15 13:29:26 (9 years ago)
- Location:
- stable
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources reverse-merged: 13164-13165,13237,13261
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests reverse-merged: 13237
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab-3.3/Samples/SamplesUtils.cs
r13292 r13293 5 5 using HeuristicLab.Algorithms.EvolutionStrategy; 6 6 using HeuristicLab.Algorithms.GeneticAlgorithm; 7 using HeuristicLab.Algorithms.OffspringSelectionEvolutionStrategy;8 7 using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm; 9 8 using HeuristicLab.Data; … … 72 71 } 73 72 74 public static void ConfigureOffspringSelectionEvolutionStrategyParameters<R, M, SC, SR, SM>(OffspringSelectionEvolutionStrategy es, int popSize,75 double successRatio, double comparisonFactor, double maxSelPres, int parentsPerChild, int maxGens, bool plusSelection)76 where R : ICrossover77 where M : IManipulator78 where SC : IStrategyParameterCreator79 where SR : IStrategyParameterCrossover80 where SM : IStrategyParameterManipulator {81 es.PopulationSize.Value = popSize;82 es.ComparisonFactor.Value = comparisonFactor;83 es.SuccessRatio.Value = successRatio;84 es.MaximumSelectionPressure.Value = maxSelPres;85 es.ParentsPerChild.Value = parentsPerChild;86 es.SelectedParents.Value = popSize * parentsPerChild;87 es.MaximumGenerations.Value = maxGens;88 es.PlusSelection.Value = false;89 90 es.Seed.Value = 0;91 es.SetSeedRandomly.Value = true;92 93 es.Recombinator = es.RecombinatorParameter.ValidValues94 .OfType<R>()95 .Single();96 97 es.Mutator = es.MutatorParameter.ValidValues98 .OfType<M>()99 .Single();100 101 es.StrategyParameterCreator = es.StrategyParameterCreatorParameter.ValidValues102 .OfType<SC>()103 .Single();104 es.StrategyParameterCrossover = es.StrategyParameterCrossoverParameter.ValidValues105 .OfType<SR>()106 .Single();107 es.StrategyParameterManipulator = es.StrategyParameterManipulatorParameter.ValidValues108 .OfType<SM>()109 .Single();110 es.Engine = new ParallelEngine.ParallelEngine();111 }112 113 73 public static void ConfigureGeneticAlgorithmParameters<S, C, M>(GeneticAlgorithm ga, int popSize, int elites, int maxGens, double mutationRate, int tournGroupSize = 0) 114 74 where S : ISelector … … 234 194 235 195 ga.MaximumGenerations = maxGens; 236 196 237 197 ga.Engine = new ParallelEngine.ParallelEngine(); 238 198 }
Note: See TracChangeset
for help on using the changeset viewer.