Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10937


Ignore:
Timestamp:
06/04/14 12:59:15 (11 years ago)
Author:
mkommend
Message:

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

File:
1 edited

Legend:

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

    r10594 r10937  
    101101      var bestQuality = qualities[ind].Value;
    102102      var bestParameterVector = (RealVector)parameterVectors[ind].Clone();
     103      ResultCollection results = ResultsParameter.ActualValue;
    103104
    104105      if (BestQualityParameter.ActualValue == null) {
     
    110111          || !max && bestQuality < BestQualityParameter.ActualValue.Value) {
    111112        BestQualityParameter.ActualValue.Value = bestQuality;
    112         ResultCollection results = ResultsParameter.ActualValue;
    113113        if (results.ContainsKey(BestSolutionResultName)) {
    114114          var bestSolution = (DoubleArray)results[BestSolutionResultName].Value;
     
    116116          for (int i = 0; i < bestParameterVector.Length; i++)
    117117            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;
    122118        }
     119      } else if (!results.ContainsKey(BestSolutionResultName)) {
     120        results.Add(new Result(BestSolutionResultName, new DoubleArray(bestParameterVector.ToArray())));
     121        var bestSolution = (DoubleArray)results[BestSolutionResultName].Value;
     122        bestSolution.ElementNames = ParameterNamesParameter.ActualValue;
    123123      }
    124 
    125124      //update best known quality
    126125      if (bestKnownQuality == null || max && bestQuality > bestKnownQuality.Value
Note: See TracChangeset for help on using the changeset viewer.