Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11019


Ignore:
Timestamp:
06/16/14 10:29:26 (11 years ago)
Author:
mkommend
Message:

#2193: Fixed bugs in BestSolutionAnalyzer for parameter optimization problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.ParameterOptimization/3.3/BestSolutionAnalyzer.cs

    r10937 r11019  
    108108      }
    109109
    110       if (max && bestQuality > BestQualityParameter.ActualValue.Value
    111           || !max && bestQuality < BestQualityParameter.ActualValue.Value) {
    112         BestQualityParameter.ActualValue.Value = bestQuality;
    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         }
    119       } else if (!results.ContainsKey(BestSolutionResultName)) {
     110      if (!results.ContainsKey(BestSolutionResultName)) {
    120111        results.Add(new Result(BestSolutionResultName, new DoubleArray(bestParameterVector.ToArray())));
    121112        var bestSolution = (DoubleArray)results[BestSolutionResultName].Value;
    122113        bestSolution.ElementNames = ParameterNamesParameter.ActualValue;
     114        BestQualityParameter.ActualValue.Value = bestQuality;
     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      }
     123
    124124      //update best known quality
    125125      if (bestKnownQuality == null || max && bestQuality > bestKnownQuality.Value
Note: See TracChangeset for help on using the changeset viewer.