Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/29/20 15:18:44 (4 years ago)
Author:
abeham
Message:

#2521: remove scope-based contexts, add helper methods to ScopeUtil, adapt operators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveMoveEvaluator.cs

    r17366 r17577  
    7070      var random = RandomParameter.ActualValue;
    7171      var encoding = EncodingParameter.ActualValue;
    72       var solution = ScopeUtil.GetEncodedSolution(ExecutionContext.Scope, encoding);
    73       var solutionContext = new SingleObjectiveSolutionContextScope<TEncodedSolution>(ExecutionContext.Scope, solution);
     72      var solutionContext = ScopeUtil.CreateSolutionContext(ExecutionContext.Scope, encoding);
    7473
    75       Evaluate(solutionContext, random, CancellationToken.None);
     74      if (!solutionContext.IsEvaluated)
     75        Evaluate(solutionContext, random, CancellationToken.None);
    7676      var qualityValue = solutionContext.EvaluationResult.Quality;
    7777
    7878      MoveQualityParameter.ActualValue = new DoubleValue(qualityValue);
     79      ScopeUtil.CopyToScope(ExecutionContext.Scope, solutionContext);
    7980      return base.Apply();
    8081    }
Note: See TracChangeset for help on using the changeset viewer.