Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/04/19 17:31:54 (5 years ago)
Author:
mkommend
Message:

#2521: Added cancellation token to evaluate function of problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs

    r17226 r17320  
    2323using System;
    2424using System.Collections.Generic;
     25using System.Threading;
     26using HEAL.Attic;
    2527using HeuristicLab.Common;
    2628using HeuristicLab.Core;
    2729using HeuristicLab.Encodings.BinaryVectorEncoding;
    2830using HeuristicLab.Optimization;
    29 using HEAL.Attic;
    3031
    3132namespace HeuristicLab.Algorithms.ParameterlessPopulationPyramid {
     
    9394    }
    9495
     96    public double Evaluate(BinaryVector vector, IRandom random) {
     97      return Evaluate(vector, random, CancellationToken.None);
     98    }
    9599
    96 
    97     public double Evaluate(BinaryVector vector, IRandom random) {
     100    public double Evaluate(BinaryVector vector, IRandom random, CancellationToken cancellationToken) {
    98101      if (Evaluations >= maxEvaluations) throw new OperationCanceledException("Maximum Evaluation Limit Reached");
    99102      Evaluations++;
Note: See TracChangeset for help on using the changeset viewer.