Changeset 13771 for branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/MultiObjectiveTestFunctionProblem.cs
- Timestamp:
- 04/18/16 10:50:15 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/MultiObjectiveTestFunctionProblem.cs
r13729 r13771 161 161 } 162 162 163 public IEnumerable<double[]> BestKnownFront { 164 get { 165 return Parameters.ContainsKey("BestKnownFront") ? TestFunction.OptimalParetoFront(Objectives) : null; 166 } 167 } 168 163 169 public double[] Evaluate(RealVector individual, IRandom random) { 164 170 return TestFunction.Evaluate(individual, Objectives); … … 228 234 || ProblemSize > TestFunction.MaximumSolutionLength) 229 235 ProblemSize = Math.Min(TestFunction.MaximumSolutionLength, Math.Max(TestFunction.MinimumSolutionLength, ProblemSize)); 236 237 230 238 Parameterize(); 231 239 } … … 244 252 Operators.Add(new SpacingAnalyzer()); 245 253 Operators.Add(new ScatterPlotAnalyzer()); 254 Operators.Add(new NormalizedHypervolumeAnalyzer()); 246 255 ParameterizeAnalyzers(); 247 256 Parameterize(); … … 250 259 private void Parameterize() { 251 260 MaximizationParameter.ActualValue = new BoolArray(Maximization); 261 var front = BestKnownFront; 262 if (front != null) { BestKnownFrontParameter.ActualValue = new DoubleMatrix(To2D(front.ToArray<double[]>())); } 263 252 264 } 253 265 … … 259 271 analyzer.BestKnownFrontParameter.ActualName = BestKnownFrontParameter.Name; 260 272 261 BestKnownFrontParameter.ActualValue = new DoubleMatrix(To2D(TestFunction.OptimalParetoFront(Objectives).ToArray<double[]>())); 273 274 var front = BestKnownFront; 275 if (front != null) { BestKnownFrontParameter.ActualValue = new DoubleMatrix(To2D(front.ToArray<double[]>())); } 276 277 262 278 if (analyzer is HypervolumeAnalyzer) { 263 279 ((HypervolumeAnalyzer)analyzer).ReferencePointParameter.Value = new DoubleArray(TestFunction.ReferencePoint(Objectives)); … … 265 281 } 266 282 283 if (analyzer is NormalizedHypervolumeAnalyzer) { 284 ((NormalizedHypervolumeAnalyzer)analyzer).OptimalFrontParameter.ActualValue = (DoubleMatrix)BestKnownFrontParameter.ActualValue; 285 } 286 267 287 } 268 288 }
Note: See TracChangeset
for help on using the changeset viewer.