Changeset 17745 for branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessCovarianceOptimizationProblem.cs
- Timestamp:
- 09/15/20 13:53:11 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessCovarianceOptimizationProblem.cs
r17655 r17745 274 274 } 275 275 276 public override void Analyze(ISymbolicExpressionTree[] trees, double[] qualities, ResultCollection results, IRandom random) { 277 if (!results.ContainsKey("Best Solution Quality")) { 278 results.Add(new Result("Best Solution Quality", typeof(DoubleValue))); 279 } 280 if (!results.ContainsKey("Best Tree")) { 281 results.Add(new Result("Best Tree", typeof(ISymbolicExpressionTree))); 282 } 283 if (!results.ContainsKey("Best Solution")) { 284 results.Add(new Result("Best Solution", typeof(GaussianProcessRegressionSolution))); 285 } 286 287 var bestQuality = qualities.Max(); 288 289 if (results["Best Solution Quality"].Value == null || bestQuality > ((DoubleValue)results["Best Solution Quality"].Value).Value) { 290 var bestIdx = Array.IndexOf(qualities, bestQuality); 291 var bestClone = (ISymbolicExpressionTree)trees[bestIdx].Clone(); 292 results["Best Tree"].Value = bestClone; 293 results["Best Solution Quality"].Value = new DoubleValue(bestQuality); 294 results["Best Solution"].Value = CreateSolution(); 295 } 276 277 public override void Analyze(ISingleObjectiveSolutionContext<ISymbolicExpressionTree>[] solutionContexts, IRandom random) { 278 //TODO: reimplement code below with results parameter 279 280 //if (!results.ContainsKey("Best Solution Quality")) { 281 // results.Add(new Result("Best Solution Quality", typeof(DoubleValue))); 282 //} 283 //if (!results.ContainsKey("Best Tree")) { 284 // results.Add(new Result("Best Tree", typeof(ISymbolicExpressionTree))); 285 //} 286 //if (!results.ContainsKey("Best Solution")) { 287 // results.Add(new Result("Best Solution", typeof(GaussianProcessRegressionSolution))); 288 //} 289 290 //var bestQuality = qualities.Max(); 291 292 //if (results["Best Solution Quality"].Value == null || bestQuality > ((DoubleValue)results["Best Solution Quality"].Value).Value) { 293 // var bestIdx = Array.IndexOf(qualities, bestQuality); 294 // var bestClone = (ISymbolicExpressionTree)trees[bestIdx].Clone(); 295 // results["Best Tree"].Value = bestClone; 296 // results["Best Solution Quality"].Value = new DoubleValue(bestQuality); 297 // results["Best Solution"].Value = CreateSolution(); 298 //} 296 299 } 297 300
Note: See TracChangeset
for help on using the changeset viewer.