Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/09/17 00:36:20 (7 years ago)
Author:
abeham
Message:

#2701:

  • Added alternating bits binary test Problem
  • Refactored MemPR to work with programmable problem in current trunk
  • fixed a bug in permutation MemPR when crossover doesn't assign an offspring
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Permutation/LocalSearch/StaticAPI/Exhaustive1Shift.cs

    r14456 r14552  
    3131  public static class Exhaustive1Shift {
    3232    public static Tuple<int, int> HillClimb(IRandom random, Encodings.PermutationEncoding.Permutation perm,
    33       ref double quality, bool maximization, Func<Encodings.PermutationEncoding.Permutation, double> eval,
     33      ref double quality, bool maximization, Func<Encodings.PermutationEncoding.Permutation, CancellationToken, double> eval,
    3434      CancellationToken token, bool[,] subspace = null) {
    3535      var evaluations = 0;
    3636      var current = perm;
    3737      if (double.IsNaN(quality)) {
    38         quality = eval(current);
     38        quality = eval(current, token);
    3939        evaluations++;
    4040      }
     
    5959            continue;
    6060          TranslocationManipulator.Apply(current, shift.Index1, shift.Index2, shift.Index3);
    61           var q = eval(current);
     61          var q = eval(current, token);
    6262          evaluations++;
    6363          if (FitnessComparer.IsBetter(maximization, q, quality)) {
Note: See TracChangeset for help on using the changeset viewer.