Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/12/10 11:34:13 (13 years ago)
Author:
cneumuel
Message:

#1215

  • enabled multiple problems
  • enabled n repetitions
  • improved results output
  • reduced memory footprint significantly
  • removed viewhost icons for less screen space waste
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/BestParameterConfigurationAnalyzer.cs

    r5023 r5087  
    4040    }
    4141
    42     public BestParameterConfigurationAnalyzer() : base() {
     42    public BestParameterConfigurationAnalyzer()
     43      : base() {
    4344      Parameters.Add(new ScopeTreeLookupParameter<ParameterConfigurationTree>("ParameterConfigurationTree", "TODO The TSP solutions given in path representation from which the best solution should be analyzed."));
    4445      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "TODO The qualities of the TSP solutions which should be analyzed."));
     
    6364      ItemArray<ParameterConfigurationTree> parameterTrees = ParameterConfigurationParameter.ActualValue;
    6465
    65       int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
     66      int idxBest = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
    6667
    67       EngineAlgorithm bestAlg = ((EngineAlgorithm)((ParameterConfigurationTree)parameterTrees[i]).ActualValue.Value);
    68       Run bestRun = new Run(bestAlg);
    69       ((ParameterConfigurationTree)parameterTrees[i]).CollectResultValues(bestRun.Results);
    7068
    71       if (bestKnownQuality == null || qualities[i].Value < bestKnownQuality.Value) { // todo: respect Maximization:true/false
    72         BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
     69      ParameterConfigurationTree best = (ParameterConfigurationTree)parameterTrees[idxBest];
     70      IRun bestRun = new Run();
     71      best.CollectResultValues(bestRun.Results);
     72      best.CollectParameterValues(bestRun.Parameters);
     73
     74      if (bestKnownQuality == null || qualities[idxBest].Value < bestKnownQuality.Value) { // todo: respect Maximization:true/false
     75        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[idxBest].Value);
     76
    7377        BestKnownSolutionParameter.ActualValue = bestRun;
    7478      }
    7579
    76       IRun best = BestSolutionParameter.ActualValue;
    77       if (best == null) {
     80      if (BestSolutionParameter.ActualValue == null) {
    7881        BestSolutionParameter.ActualValue = bestRun;
    7982        results.Add(new Result("Best Parameter Settings", bestRun));
     
    8487
    8588      // population
     89
     90      int i = 0;
    8691      RunCollection rc = new RunCollection();
    8792      foreach (ParameterConfigurationTree pt in parameterTrees.OrderByDescending(x => x.BestQuality.Value)) { // todo: respect Maximization:true/false
    88         IAlgorithm alg = (IAlgorithm)pt.ActualValue.Value;
    89         alg.StoreAlgorithmInEachRun = false;
    90         IRun run = new Run(alg);
     93        IRun run = new Run();
     94        run.Name = string.Format("Individuum ({0})", i);
    9195        pt.CollectResultValues(run.Results);
     96        pt.CollectParameterValues(run.Parameters);
    9297        rc.Add(run);
     98        i++;
    9399      }
    94100      if (PopulationParameter.ActualValue == null) {
Note: See TracChangeset for help on using the changeset viewer.