Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/17 01:53:44 (8 years ago)
Author:
abeham
Message:

#2701:

  • fixed bug with breeding
  • fixed permutation sub-space hillclimber
  • improved speed of inversion by calling Array.Reverse(int, int) instead of using a for-loop
  • added delinking for relative-undirected permutations
Location:
branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Permutation/LocalSearch
Files:
2 edited

Legend:

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

    r14552 r14556  
    3333  [StorableClass]
    3434  public class ExhaustiveHillClimbSubspace<TContext> : NamedItem, ILocalSearch<TContext>
    35       where TContext : ISingleSolutionHeuristicAlgorithmContext<SingleObjectiveBasicProblem<PermutationEncoding>, Encodings.PermutationEncoding.Permutation>,
     35      where TContext : ISingleSolutionHeuristicAlgorithmContext<ISingleObjectiveHeuristicOptimizationProblem, Encodings.PermutationEncoding.Permutation>,
    3636                       IPermutationSubspaceContext, IEvaluationServiceContext<Encodings.PermutationEncoding.Permutation> {
    3737
     
    5252      try {
    5353        var result = Exhaustive.HillClimb(context.Random, context.Solution.Solution, ref quality,
    54           context.Problem.Maximization, context.Evaluate, CancellationToken.None, context.Subspace.Subspace);
     54          context.Maximization, context.Evaluate, CancellationToken.None, context.Subspace.Subspace);
    5555        context.IncrementEvaluatedSolutions(result.Item1);
    5656        context.Iterations = result.Item2;
  • branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Permutation/LocalSearch/StaticAPI/Exhaustive2Opt.cs

    r14552 r14556  
    5555            continue;
    5656
    57           InversionManipulator.Apply(current, opt.Index1, opt.Index2);
     57          current.Reverse(opt.Index1, opt.Index2 - opt.Index1 + 1);
    5858          var q = eval(current, token);
    5959          evaluations++;
     
    6262            quality = q;
    6363            lastSuccessMove = opt;
    64           } else InversionManipulator.Apply(current, opt.Index1, opt.Index2);
     64          } else current.Reverse(opt.Index1, opt.Index2 - opt.Index1 + 1);
    6565
    6666          if (token.IsCancellationRequested) {
Note: See TracChangeset for help on using the changeset viewer.