Changeset 17363 for branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveEvaluator.cs
- Timestamp:
- 11/21/19 17:58:32 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveEvaluator.cs
r17226 r17363 46 46 } 47 47 48 public Func<TEncodedSolution, IRandom, double> EvaluateFunc{ get; set; }48 public Action<ISingleObjectiveSolutionContext<TEncodedSolution>, IRandom> Evaluate { get; set; } 49 49 50 50 [StorableConstructor] … … 63 63 var encoding = EncodingParameter.ActualValue; 64 64 var solution = ScopeUtil.GetEncodedSolution(ExecutionContext.Scope, encoding); 65 QualityParameter.ActualValue = new DoubleValue(EvaluateFunc(solution, random)); 65 var solutionContext = new SingleObjectiveSolutionContextScope<TEncodedSolution>(ExecutionContext.Scope, solution); 66 67 Evaluate(solutionContext, random); 68 var qualityValue = solutionContext.EvaluationResult.Quality; 69 70 QualityParameter.ActualValue = new DoubleValue(qualityValue); 66 71 return base.InstrumentedApply(); 67 72 }
Note: See TracChangeset
for help on using the changeset viewer.