Changeset 17363 for branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveMoveEvaluator.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/SingleObjectiveMoveEvaluator.cs
r17226 r17363 50 50 } 51 51 52 public Func<TEncodedSolution, IRandom, double> EvaluateFunc{ get; set; }52 public Action<ISingleObjectiveSolutionContext<TEncodedSolution>, IRandom> Evaluate { get; set; } 53 53 54 54 [StorableConstructor] … … 69 69 var random = RandomParameter.ActualValue; 70 70 var encoding = EncodingParameter.ActualValue; 71 var individual = ScopeUtil.GetEncodedSolution(ExecutionContext.Scope, encoding); 72 MoveQualityParameter.ActualValue = new DoubleValue(EvaluateFunc(individual, random)); 71 var solution = ScopeUtil.GetEncodedSolution(ExecutionContext.Scope, encoding); 72 var solutionContext = new SingleObjectiveSolutionContextScope<TEncodedSolution>(ExecutionContext.Scope, solution); 73 74 Evaluate(solutionContext, random); 75 var qualityValue = solutionContext.EvaluationResult.Quality; 76 77 MoveQualityParameter.ActualValue = new DoubleValue(qualityValue); 73 78 return base.Apply(); 74 79 }
Note: See TracChangeset
for help on using the changeset viewer.