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/SingleObjectiveAnalyzer.cs

    r17381 r17577  
    7979
    8080      var solutionContexts = scopes.Select(scope => {
    81         var solution = ScopeUtil.GetEncodedSolution(scope, encoding);
    82         var quality = ((DoubleValue)scope.Variables[QualityParameter.ActualName].Value).Value;
    83         var solutionContext = new SingleObjectiveSolutionContextScope<TEncodedSolution>(scope, solution);
    84         return solutionContext;
     81        return ScopeUtil.CreateSolutionContext(scope, encoding);
    8582      }).ToArray();
    8683
    8784      Analyze(solutionContexts, results, random);
     85      foreach (var s in solutionContexts.Zip(scopes, Tuple.Create)) {
     86        ScopeUtil.CopyToScope(s.Item2, s.Item1);
     87      }
    8888      return base.Apply();
    8989    }
Note: See TracChangeset for help on using the changeset viewer.