Changeset 14556 for branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Permutation/LocalSearch
- Timestamp:
- 01/11/17 01:53:44 (8 years ago)
- 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 33 33 [StorableClass] 34 34 public class ExhaustiveHillClimbSubspace<TContext> : NamedItem, ILocalSearch<TContext> 35 where TContext : ISingleSolutionHeuristicAlgorithmContext< SingleObjectiveBasicProblem<PermutationEncoding>, Encodings.PermutationEncoding.Permutation>,35 where TContext : ISingleSolutionHeuristicAlgorithmContext<ISingleObjectiveHeuristicOptimizationProblem, Encodings.PermutationEncoding.Permutation>, 36 36 IPermutationSubspaceContext, IEvaluationServiceContext<Encodings.PermutationEncoding.Permutation> { 37 37 … … 52 52 try { 53 53 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); 55 55 context.IncrementEvaluatedSolutions(result.Item1); 56 56 context.Iterations = result.Item2; -
branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Permutation/LocalSearch/StaticAPI/Exhaustive2Opt.cs
r14552 r14556 55 55 continue; 56 56 57 InversionManipulator.Apply(current, opt.Index1, opt.Index2);57 current.Reverse(opt.Index1, opt.Index2 - opt.Index1 + 1); 58 58 var q = eval(current, token); 59 59 evaluations++; … … 62 62 quality = q; 63 63 lastSuccessMove = opt; 64 } else InversionManipulator.Apply(current, opt.Index1, opt.Index2);64 } else current.Reverse(opt.Index1, opt.Index2 - opt.Index1 + 1); 65 65 66 66 if (token.IsCancellationRequested) {
Note: See TracChangeset
for help on using the changeset viewer.