Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7253


Ignore:
Timestamp:
01/02/12 10:57:21 (13 years ago)
Author:
gkronber
Message:

#1727 set the number of evaluated solutions to 1 if the result is missing in the algorithm.

Location:
branches/HeuristicLab.MetaOptimization
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization

    • Property svn:ignore
      •  

        old new  
        77TraceAndTestImpact.testsettings
        88HeuristicLab.MetaOptimization.sln.docstates.suo
         9_ReSharper.HeuristicLab.MetaOptimization
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmEvaluator.cs

    r6473 r7253  
    33using HeuristicLab.Core;
    44using HeuristicLab.Data;
    5 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    65using HeuristicLab.Operators;
    76using HeuristicLab.Optimization;
     
    5857      if (!isValidScope) return base.Apply();
    5958
    60       ItemDictionary<StringValue, RunCollection> solutionCache = ResultsParameter.ActualValue.ContainsKey("SolutionCache") ? (ItemDictionary<StringValue, RunCollection>)ResultsParameter.ActualValue["SolutionCache"].Value : null;
     59      ItemDictionary<StringValue, RunCollection> solutionCache =
     60        ResultsParameter.ActualValue.ContainsKey("SolutionCache") ?
     61        (ItemDictionary<StringValue, RunCollection>)ResultsParameter.ActualValue["SolutionCache"].Value :
     62        null;
    6163      ParameterConfigurationTree parameterConfiguration = ParameterConfigurationParameter.ActualValue;
    6264      IAlgorithm algorithm = AlgorithmParameter.ActualValue;
     
    7072      return base.Apply();
    7173    }
    72 
    73     // for debug purposes, remove later
    74     private static string PrintGrammar(ISymbolicExpressionGrammar grammar) {
    75       return string.Join(string.Empty, grammar.Symbols.Select(x => x.InitialFrequency).ToArray());
    76       //foreach (var symbol in grammar.Symbols) {
    77       //  Console.WriteLine("{0} ({1})", symbol.ToString(), symbol.InitialFrequency);
    78       //}
    79     }
    8074  }
    8175}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmRunsAnalyzer.cs

    r6489 r7253  
    156156          run.Results.Add("Meta-ProblemIndex", new IntValue(problemIndex));
    157157          run.Name = string.Format("{0} Problem {1} Run {2}", parameterConfiguration.ParameterInfoString, problemIndex, repetitionIndex);
    158          
    159           qualities[problemIndex][repetitionIndex] = GetResultValue<DoubleValue>(run.Results, qualityMeasureName).Value; 
     158
     159          qualities[problemIndex][repetitionIndex] = GetResultValue<DoubleValue>(run.Results, qualityMeasureName).Value;
    160160          executionTimes[problemIndex][repetitionIndex] = (((TimeSpanValue)run.Results["Execution Time"]).Value);
    161           evaluatedSolutions[problemIndex][repetitionIndex] = (((IntValue)run.Results["EvaluatedSolutions"]).Value);
     161          if (run.Results.ContainsKey("EvaluatedSolutions")) {
     162            evaluatedSolutions[problemIndex][repetitionIndex] = (((IntValue)run.Results["EvaluatedSolutions"]).Value);
     163          } else {
     164            evaluatedSolutions[problemIndex][repetitionIndex] = 1;
     165          }
    162166          runs.Add(run);
    163167        }
     
    208212      // in OSGA there are more subscopes, so be careful which to delete
    209213      CurrentScope.SubScopes.RemoveAll(x => x.Variables.Count((v) => (v.Name == "RepetitionCount")) == 1);
    210      
     214
    211215      return base.Apply();
    212216    }
Note: See TracChangeset for help on using the changeset viewer.