Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5576


Ignore:
Timestamp:
03/01/11 10:25:48 (14 years ago)
Author:
cneumuel
Message:

#1215

  • implemented best solution history analyzer
  • implemented quality analyzer for each base-level problem
Location:
branches/HeuristicLab.MetaOptimization
Files:
2 added
6 edited

Legend:

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

    r5522 r5576  
    4848    //private static int baseAlgorithmMaxGenerations = 1000;
    4949
    50     private static int metaAlgorithmPopulationSize = 20;
    51     private static int metaAlgorithmMaxGenerations = 20;
     50    private static int metaAlgorithmPopulationSize = 5;
     51    private static int metaAlgorithmMaxGenerations = 15;
    5252    private static int metaProblemRepetitions = 2;
    53     private static int baseAlgorithmMaxGenerations = 10;
     53    private static int baseAlgorithmMaxGenerations = 5;
    5454    private static double mutationProbability = 0.10;
    5555
     
    638638        ProblemSize = new IntValue(2)
    639639      });
    640       //metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
    641       //  Evaluator = new GriewankEvaluator(),
    642       //  ProblemSize = new IntValue(20)
    643       //});
    644       //metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
    645       //  Evaluator = new GriewankEvaluator(),
    646       //  ProblemSize = new IntValue(500)
    647       //});
    648 
    649       ConfigurePopulationSize(algorithmVc, 0, 20, 1);
     640      metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
     641        Evaluator = new GriewankEvaluator(),
     642        ProblemSize = new IntValue(20)
     643      });
     644      metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
     645        Evaluator = new GriewankEvaluator(),
     646        ProblemSize = new IntValue(500)
     647      });
     648
     649      ConfigurePopulationSize(algorithmVc, 5, 20, 1);
    650650      ConfigureMutationRate(algorithmVc, 0.0, 1.0, 0.01);
    651651      ConfigureMutationOperator(algorithmVc);
    652       ConfigureElites(algorithmVc, 0, 30, 1);
     652      //ConfigureElites(algorithmVc, 0, 30, 1);
    653653      ConfigureSelectionOperator(algorithmVc, true);
    654654      return algorithmVc;
     
    855855                var orderedRuns = rc.OrderBy(x => x.Results["AverageQualityNormalized"]);
    856856
    857                 TableBuilder tb = new TableBuilder("QNorm", "Qualities", "PoSi", "MutRa", "Eli", "SelOp", "MutOp", "NrSelSubScopes");
     857                TableBuilder tb = new TableBuilder("QNorm", "Qualities", "PoSi", "MutRa", /*"Eli",*/ "SelOp", "MutOp", "NrSelSubScopes");
    858858                foreach (IRun run in orderedRuns) {
    859859                  string selector;
     
    869869                    ((IntValue)run.Parameters["PopulationSize"]).Value.ToString(),
    870870                    ((DoubleValue)run.Parameters["MutationProbability"]).Value.ToString("0.0000"),
    871                     ((IntValue)run.Parameters["Elites"]).Value.ToString(),
     871                    //((IntValue)run.Parameters["Elites"]).Value.ToString(),
    872872                    Shorten(selector, 20),
    873873                    Shorten(run.Parameters.ContainsKey("Mutator") ? run.Parameters["Mutator"].ToString() : "null", 40),
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/BestParameterConfigurationAnalyzer.cs

    r5359 r5576  
    9797      RunCollection rc = new RunCollection();
    9898      foreach (ParameterConfigurationTree pt in parameterTrees.OrderBy(x => x.AverageQualityNormalized)) { // todo: respect Maximization:true/false
    99         IRun run = new Run();
    100         run.Name = string.Format("Individual {0} ({1})", i, pt.ParameterInfoString);
    101         pt.CollectResultValues(run.Results);
    102         pt.CollectParameterValues(run.Parameters);
    103         MetaOptimizationUtil.ClearParameters(run, pt.GetOptimizedParameterNames());
    104         rc.Add(run);
     99        rc.Add(pt.ToRun(string.Format("Individual {0} ({1})", i, pt.ParameterInfoString)));
    105100        i++;
    106101      }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs

    r5359 r5576  
    240240      return this.Name;
    241241    }
     242
     243    public IRun ToRun() {
     244      return ToRun(this.ParameterInfoString);
     245    }
     246
     247    public IRun ToRun(string name) {
     248      IRun run = new Run();
     249      run.Name = name;
     250      this.CollectResultValues(run.Results);
     251      this.CollectParameterValues(run.Parameters);
     252      MetaOptimizationUtil.ClearParameters(run, this.GetOptimizedParameterNames());
     253      return run;
     254    }
    242255  }
    243256}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/Range.cs

    r5522 r5576  
    5353        if (stepSize != value) {
    5454          if (stepSize != null) {
    55             stepSize.ValueChanged -= new EventHandler(upperBound_ToStringChanged);
     55            stepSize.ValueChanged -= new EventHandler(stepSize_ToStringChanged);
    5656          }
    5757          stepSize = value;
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/HeuristicLab.Problems.MetaOptimization-3.3.csproj

    r5522 r5576  
    139139  <ItemGroup>
    140140    <Compile Include="Analyzers\BestParameterConfigurationAnalyzer.cs" />
     141    <Compile Include="Analyzers\PMOBestSolutionHistoryAnalyzer.cs" />
     142    <Compile Include="Analyzers\PMOProblemQualitiesAnalyzer.cs" />
    141143    <Compile Include="Analyzers\PMOPopulationDiversityAnalyzer.cs" />
    142144    <Compile Include="ConstrainedTypeValue.cs" />
    143145    <Compile Include="MetaOptimizationUtil.cs" />
     146    <Compile Include="Operators\Crossovers\MultiIntValueCrossover.cs" />
    144147    <Compile Include="TypeValue.cs" />
    145148    <None Include="Properties\AssemblyInfo.cs.frame" />
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/MetaOptimizationProblem.cs

    r5522 r5576  
    109109    private PMOPopulationDiversityAnalyzer PMOPopulationDiversityAnalyzer {
    110110      get { return Operators.OfType<PMOPopulationDiversityAnalyzer>().FirstOrDefault(); }
    111     }   
     111    }
     112    private PMOProblemQualitiesAnalyzer PMOProblemQualitiesAnalyzer {
     113      get { return Operators.OfType<PMOProblemQualitiesAnalyzer>().FirstOrDefault(); }
     114    }
     115    private PMOBestSolutionHistoryAnalyzer PMOBestSolutionHistoryAnalyzer {
     116      get { return Operators.OfType<PMOBestSolutionHistoryAnalyzer>().FirstOrDefault(); }
     117    }
    112118    #endregion
    113119
     
    174180      Operators.Add(new SolutionCacheAnalyzer());
    175181      Operators.Add(new PMOPopulationDiversityAnalyzer());
     182      Operators.Add(new PMOProblemQualitiesAnalyzer());
     183      Operators.Add(new PMOBestSolutionHistoryAnalyzer());
    176184    }
    177185    private void ParameterizeSolutionCreator() {
     
    193201        PMOPopulationDiversityAnalyzer.SolutionParameter.ActualName = ((RandomParameterConfigurationCreator)SolutionCreator).ParameterConfigurationParameter.ActualName;
    194202        PMOPopulationDiversityAnalyzer.StoreHistoryParameter.Value.Value = true;
     203      }
     204      if (PMOProblemQualitiesAnalyzer != null) {
     205        PMOProblemQualitiesAnalyzer.ParameterConfigurationParameter.ActualName = ((RandomParameterConfigurationCreator)SolutionCreator).ParameterConfigurationParameter.ActualName;
     206      }
     207      if (PMOBestSolutionHistoryAnalyzer != null) {
     208        PMOBestSolutionHistoryAnalyzer.ParameterConfigurationParameter.ActualName = ((RandomParameterConfigurationCreator)SolutionCreator).ParameterConfigurationParameter.ActualName;
    195209      }
    196210    }
Note: See TracChangeset for help on using the changeset viewer.