Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5204


Ignore:
Timestamp:
01/03/11 23:21:30 (14 years ago)
Author:
swagner
Message:

Stored whole population in SingleObjectiveTestFunctionSolution only in the 2D case (#1360)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions.Views/3.3/SingleObjectiveTestFunctionSolutionView.cs

    r4068 r5204  
    157157              graphics.DrawLine(cross, a - 4, b + 4, a + 4, b - 4);
    158158            }
    159             foreach (RealVector vector in Content.Population)
    160               graphics.FillEllipse(Brushes.Blue, (float)((vector[0] - xMin) * xStep - 4), (float)((vector[1] - yMin) * yStep - 4), 8.0f, 8.0f);
     159            if (Content.Population != null) {
     160              foreach (RealVector vector in Content.Population)
     161                graphics.FillEllipse(Brushes.Blue, (float)((vector[0] - xMin) * xStep - 4), (float)((vector[1] - yMin) * yStep - 4), 8.0f, 8.0f);
     162            }
    161163            if (Content.BestRealVector != null) {
    162164              graphics.FillEllipse(Brushes.Green, (float)((Content.BestRealVector[0] - xMin) * xStep - 5), (float)((Content.BestRealVector[1] - yMin) * yStep - 5), 10.0f, 10.0f);
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs

    r4722 r5204  
    109109      SingleObjectiveTestFunctionSolution solution = BestSolutionParameter.ActualValue;
    110110
    111       int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
     111      int i = -1;
     112      if (!max) i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
     113      else i = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
    112114
    113115      if (bestKnownQuality == null ||
     
    123125        ResultCollection results = ResultsParameter.ActualValue;
    124126        solution = new SingleObjectiveTestFunctionSolution(realVectors[i], qualities[i], EvaluatorParameter.ActualValue);
    125         solution.Population = realVectors;
     127        solution.Population = realVectors[i].Length == 2 ? realVectors : null;
    126128        solution.BestKnownRealVector = BestKnownSolutionParameter.ActualValue;
    127129        solution.Bounds = BoundsParameter.ActualValue;
     
    134136          solution.BestQuality = qualities[i];
    135137        }
    136         solution.Population = realVectors;
     138        solution.Population = realVectors[i].Length == 2 ? realVectors : null;
    137139      }
    138140
Note: See TracChangeset for help on using the changeset viewer.