Changeset 6421
- Timestamp:
- 06/16/11 00:13:30 (13 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs
r6197 r6421 24 24 using HeuristicLab.Problems.MetaOptimization; 25 25 using HeuristicLab.Problems.TestFunctions; 26 using HeuristicLab.Problems.TravelingSalesman; 26 27 using HeuristicLab.Random; 27 28 using HeuristicLab.Selection; … … 48 49 //private static double mutationProbability = 0.10; 49 50 50 private static int metaAlgorithmPopulationSize = 4;51 private static int metaAlgorithmPopulationSize = 30; 51 52 private static int metaAlgorithmMaxGenerations = 10; 52 53 private static double metaAlgorithmMutationProbability = 0.10; 53 54 private static int metaProblemRepetitions = 3; 54 55 private static int baseAlgorithmMaxGenerations = 20; 55 private static int baseAlgorithmPopulationSize = 10 ;56 private static int baseAlgorithmPopulationSize = 100; 56 57 57 58 public override void Run() { … … 781 782 metaOptimizationProblem.AlgorithmType.Value = baseLevelAlgorithmType; 782 783 783 metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem);784 //metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem); 784 785 //metaOptimizationProblem.Problems.Clear(); 785 786 //metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() { … … 803 804 //metaOptimizationProblem.Maximization.Value = true; 804 805 806 // tsp 807 metaOptimizationProblem.ProblemType.Value = typeof(TravelingSalesmanProblem); 808 805 809 ParameterConfigurationTree algorithmVc = metaOptimizationProblem.ParameterConfigurationTree; 806 810 ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "MaximumGenerations").ActualValue.Value).Value = baseAlgorithmMaxGenerations; 807 811 ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "PopulationSize").ActualValue.Value).Value = baseAlgorithmPopulationSize; 808 812 809 //ConfigurePopulationSize(algorithmVc, 10, 100, 1);813 ConfigurePopulationSize(algorithmVc, 10, 100, 1); 810 814 ConfigureMutationRate(algorithmVc, 0.0, 1.0, 0.01); 811 815 ConfigureMutationOperator(algorithmVc); 812 //ConfigureElites(algorithmVc, 0, 10, 1);813 //ConfigureSelectionOperator(algorithmVc, true);816 ConfigureElites(algorithmVc, 0, 10, 1); 817 ConfigureSelectionOperator(algorithmVc, true); 814 818 815 819 //ConfigureSymbolicExpressionGrammar(algorithmVc); -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/AlgorithmExecutor.cs
r6024 r6421 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Threading; 3 24 using HeuristicLab.Optimization; 4 25 5 26 namespace HeuristicLab.Problems.MetaOptimization { 6 7 27 public static class AlgorithmExtensions { 8 28 public static void StartSync(this IAlgorithm algorithm, CancellationToken cancellationToken) { -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs
r6197 r6421 230 230 var problem = algorithm.Problem; 231 231 232 ProblemConfiguration.Parameterize(problem); 232 233 AlgorithmConfiguration.Parameterize(algorithm); 233 ProblemConfiguration.Parameterize(problem);234 234 235 235 algorithm.CollectParameterValues(this.Parameters); -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs
r6197 r6421 364 364 } 365 365 366 void ValueConfigurations_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {366 private void ValueConfigurations_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) { 367 367 OnToStringChanged(); 368 368 KeepActualValueConfigurationIndexConsistent(); 369 369 } 370 370 371 void ValueConfigurations_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {371 private void ValueConfigurations_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) { 372 372 OnToStringChanged(); 373 373 KeepActualValueConfigurationIndexConsistent(); 374 374 } 375 void ValueConfigurations_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {375 private void ValueConfigurations_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) { 376 376 OnToStringChanged(); 377 377 KeepActualValueConfigurationIndexConsistent(); … … 497 497 var clonedValue = this.ActualValue.Value != null ? (IItem)this.ActualValue.Value.Clone() : null; 498 498 if (clonedValue != null) AdaptValidValues(parameter, clonedValue); 499 parameter. ActualValue = clonedValue;499 parameter.Value = clonedValue; 500 500 } 501 501 -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/PMOEvaluator.cs
r6018 r6421 72 72 var algorithmRunsAnalyzer = new AlgorithmRunsAnalyzer(); 73 73 74 uniformSubScopesProcessor.Parallel.Value = true; 75 74 76 this.OperatorGraph.InitialOperator = algorithmSubScopesCreator; 75 77 algorithmSubScopesCreator.Successor = uniformSubScopesProcessor; … … 77 79 uniformSubScopesProcessor.Successor = algorithmRunsAnalyzer; 78 80 algorithmRunsAnalyzer.Successor = null; 79 80 81 } 81 82 83 [StorableHook(HookType.AfterDeserialization)] 84 private void AfterDeserialization() { 85 ///// only for debug reasons - remove later (set this in stored algs) 86 ((UniformSubScopesProcessor)((AlgorithmSubScopesCreator)this.OperatorGraph.InitialOperator).Successor).Parallel.Value = true; 87 } 82 88 } 83 89 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Crossovers/DoubleValue/NormalDoubleValueCrossover.cs
r6197 r6421 40 40 } while (!range.IsInRange(offspring.Value)); 41 41 42 if (offspring.Value < 0)43 throw new Exception("WTF Exception");44 45 42 return offspring; 46 43 }
Note: See TracChangeset
for help on using the changeset viewer.