Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/22/19 15:54:31 (4 years ago)
Author:
mkommend
Message:

#2521: Fixed bugs in solution context and adapted programmable problem template to include a cancellation token in the evaluate function.

File:
1 edited

Legend:

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

    r17363 r17366  
    2121
    2222using System;
     23using System.Threading;
    2324using HEAL.Attic;
    2425using HeuristicLab.Common;
     
    5051    }
    5152
    52     public Action<ISingleObjectiveSolutionContext<TEncodedSolution>, IRandom> Evaluate { get; set; }
     53    public Action<ISingleObjectiveSolutionContext<TEncodedSolution>, IRandom, CancellationToken> Evaluate { get; set; }
    5354
    5455    [StorableConstructor]
     
    7273      var solutionContext = new SingleObjectiveSolutionContextScope<TEncodedSolution>(ExecutionContext.Scope, solution);
    7374
    74       Evaluate(solutionContext, random);
     75      Evaluate(solutionContext, random, CancellationToken.None);
    7576      var qualityValue = solutionContext.EvaluationResult.Quality;
    7677
Note: See TracChangeset for help on using the changeset viewer.