Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6421


Ignore:
Timestamp:
06/16/11 00:13:30 (13 years ago)
Author:
cneumuel
Message:

#1215

  • small fixes
Location:
branches/HeuristicLab.MetaOptimization
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs

    r6197 r6421  
    2424using HeuristicLab.Problems.MetaOptimization;
    2525using HeuristicLab.Problems.TestFunctions;
     26using HeuristicLab.Problems.TravelingSalesman;
    2627using HeuristicLab.Random;
    2728using HeuristicLab.Selection;
     
    4849    //private static double mutationProbability = 0.10;
    4950
    50     private static int metaAlgorithmPopulationSize = 4;
     51    private static int metaAlgorithmPopulationSize = 30;
    5152    private static int metaAlgorithmMaxGenerations = 10;
    5253    private static double metaAlgorithmMutationProbability = 0.10;
    5354    private static int metaProblemRepetitions = 3;
    5455    private static int baseAlgorithmMaxGenerations = 20;
    55     private static int baseAlgorithmPopulationSize = 10;
     56    private static int baseAlgorithmPopulationSize = 100;
    5657
    5758    public override void Run() {
     
    781782      metaOptimizationProblem.AlgorithmType.Value = baseLevelAlgorithmType;
    782783
    783       metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem);
     784      //metaOptimizationProblem.ProblemType.Value = typeof(SingleObjectiveTestFunctionProblem);
    784785      //metaOptimizationProblem.Problems.Clear();
    785786      //metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
     
    803804      //metaOptimizationProblem.Maximization.Value = true;
    804805
     806      // tsp
     807      metaOptimizationProblem.ProblemType.Value = typeof(TravelingSalesmanProblem);
     808
    805809      ParameterConfigurationTree algorithmVc = metaOptimizationProblem.ParameterConfigurationTree;
    806810      ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "MaximumGenerations").ActualValue.Value).Value = baseAlgorithmMaxGenerations;
    807811      ((IntValue)algorithmVc.AlgorithmConfiguration.ParameterConfigurations.Single(x => x.Name == "PopulationSize").ActualValue.Value).Value = baseAlgorithmPopulationSize;
    808812
    809       //ConfigurePopulationSize(algorithmVc, 10, 100, 1);
     813      ConfigurePopulationSize(algorithmVc, 10, 100, 1);
    810814      ConfigureMutationRate(algorithmVc, 0.0, 1.0, 0.01);
    811815      ConfigureMutationOperator(algorithmVc);
    812       //ConfigureElites(algorithmVc, 0, 10, 1);
    813       //ConfigureSelectionOperator(algorithmVc, true);
     816      ConfigureElites(algorithmVc, 0, 10, 1);
     817      ConfigureSelectionOperator(algorithmVc, true);
    814818
    815819      //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
     22using System;
    223using System.Threading;
    324using HeuristicLab.Optimization;
    425
    526namespace HeuristicLab.Problems.MetaOptimization {
    6 
    727  public static class AlgorithmExtensions {
    828    public static void StartSync(this IAlgorithm algorithm, CancellationToken cancellationToken) {
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs

    r6197 r6421  
    230230      var problem = algorithm.Problem;
    231231
     232      ProblemConfiguration.Parameterize(problem);
    232233      AlgorithmConfiguration.Parameterize(algorithm);
    233       ProblemConfiguration.Parameterize(problem);
    234234
    235235      algorithm.CollectParameterValues(this.Parameters);
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs

    r6197 r6421  
    364364    }
    365365
    366     void ValueConfigurations_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
     366    private void ValueConfigurations_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
    367367      OnToStringChanged();
    368368      KeepActualValueConfigurationIndexConsistent();
    369369    }
    370370
    371     void ValueConfigurations_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
     371    private void ValueConfigurations_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
    372372      OnToStringChanged();
    373373      KeepActualValueConfigurationIndexConsistent();
    374374    }
    375     void ValueConfigurations_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
     375    private void ValueConfigurations_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
    376376      OnToStringChanged();
    377377      KeepActualValueConfigurationIndexConsistent();
     
    497497      var clonedValue = this.ActualValue.Value != null ? (IItem)this.ActualValue.Value.Clone() : null;
    498498      if (clonedValue != null) AdaptValidValues(parameter, clonedValue);
    499       parameter.ActualValue = clonedValue;
     499      parameter.Value = clonedValue;
    500500    }
    501501
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/PMOEvaluator.cs

    r6018 r6421  
    7272      var algorithmRunsAnalyzer = new AlgorithmRunsAnalyzer();
    7373
     74      uniformSubScopesProcessor.Parallel.Value = true;
     75     
    7476      this.OperatorGraph.InitialOperator = algorithmSubScopesCreator;
    7577      algorithmSubScopesCreator.Successor = uniformSubScopesProcessor;
     
    7779      uniformSubScopesProcessor.Successor = algorithmRunsAnalyzer;
    7880      algorithmRunsAnalyzer.Successor = null;
    79 
    8081    }
    8182
     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    }
    8288  }
    8389}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Crossovers/DoubleValue/NormalDoubleValueCrossover.cs

    r6197 r6421  
    4040      } while (!range.IsInRange(offspring.Value));
    4141
    42       if (offspring.Value < 0)
    43         throw new Exception("WTF Exception");
    44 
    4542      return offspring;
    4643    }
Note: See TracChangeset for help on using the changeset viewer.