Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11152


Ignore:
Timestamp:
07/08/14 20:04:46 (8 years ago)
Author:
mkommend
Message:

#2193: Merged r10937, r11019 into stable.

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.ParameterOptimization/3.3/BestSolutionAnalyzer.cs

    r11151 r11152  
    101101      var bestQuality = qualities[indexOfBest].Value;
    102102      var bestParameterVector = (RealVector)parameterVectors[indexOfBest].Clone();
     103      ResultCollection results = ResultsParameter.ActualValue;
    103104
    104105      if (BestQualityParameter.ActualValue == null) {
     
    107108      }
    108109
    109       if (max && bestQuality > BestQualityParameter.ActualValue.Value
    110           || !max && bestQuality < BestQualityParameter.ActualValue.Value) {
     110      if (!results.ContainsKey(BestSolutionResultName)) {
     111        results.Add(new Result(BestSolutionResultName, new DoubleArray(bestParameterVector.ToArray())));
     112        var bestSolution = (DoubleArray)results[BestSolutionResultName].Value;
     113        bestSolution.ElementNames = ParameterNamesParameter.ActualValue;
    111114        BestQualityParameter.ActualValue.Value = bestQuality;
    112         ResultCollection results = ResultsParameter.ActualValue;
    113         if (results.ContainsKey(BestSolutionResultName)) {
    114           var bestSolution = (DoubleArray)results[BestSolutionResultName].Value;
    115           bestSolution.ElementNames = ParameterNamesParameter.ActualValue;
    116           for (int i = 0; i < bestParameterVector.Length; i++)
    117             bestSolution[i] = bestParameterVector[i];
    118         } else {
    119           results.Add(new Result(BestSolutionResultName, new DoubleArray(bestParameterVector.ToArray())));
    120           var bestSolution = (DoubleArray)results[BestSolutionResultName].Value;
    121           bestSolution.ElementNames = ParameterNamesParameter.ActualValue;
    122         }
     115      } else if (max && bestQuality > BestQualityParameter.ActualValue.Value
     116                || !max && bestQuality < BestQualityParameter.ActualValue.Value) {
     117        var bestSolution = (DoubleArray)results[BestSolutionResultName].Value;
     118        bestSolution.ElementNames = ParameterNamesParameter.ActualValue;
     119        for (int i = 0; i < bestParameterVector.Length; i++)
     120          bestSolution[i] = bestParameterVector[i];
     121        BestQualityParameter.ActualValue.Value = bestQuality;
    123122      }
    124123
Note: See TracChangeset for help on using the changeset viewer.