- Timestamp:
- 10/04/19 17:31:54 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs
r17264 r17320 20 20 #endregion 21 21 22 using System.Threading; 22 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; … … 59 60 } 60 61 61 public override double Evaluate(Permutation tour, IRandom random ) {62 return Evaluate(tour, ProbabilisticTSPData );62 public override double Evaluate(Permutation tour, IRandom random, CancellationToken cancellationToken) { 63 return Evaluate(tour, ProbabilisticTSPData, cancellationToken); 63 64 } 64 65 65 public static double Evaluate(Permutation tour, IProbabilisticTSPData data ) {66 public static double Evaluate(Permutation tour, IProbabilisticTSPData data, CancellationToken cancellationToken) { 66 67 // Analytical evaluation 67 68 var firstSum = 0.0; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs
r17264 r17320 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Threading; 25 26 using HEAL.Attic; 26 27 using HeuristicLab.Common; … … 101 102 } 102 103 103 public override double Evaluate(Permutation tour, IRandom random ) {104 return Evaluate(tour, ProbabilisticTSPData, RealizationData );104 public override double Evaluate(Permutation tour, IRandom random, CancellationToken cancellationToken) { 105 return Evaluate(tour, ProbabilisticTSPData, RealizationData, cancellationToken); 105 106 } 106 107 … … 110 111 } 111 112 112 public static double Evaluate(Permutation tour, IProbabilisticTSPData data, IEnumerable<BoolArray> realizations ) {113 public static double Evaluate(Permutation tour, IProbabilisticTSPData data, IEnumerable<BoolArray> realizations, CancellationToken cancellationToken) { 113 114 // Estimation-based evaluation, here without calculating variance for faster evaluation 114 115 var estimatedSum = 0.0; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/Moves/OneShift/PTSPAnalyticalInsertionMoveEvaluator.cs
r17253 r17320 20 20 #endregion 21 21 22 using System.Threading; 22 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; … … 50 51 var afterMove = (Permutation)tour.Clone(); 51 52 TranslocationManipulator.Apply(afterMove, move.Index1, move.Index1, move.Index3); 52 return AnalyticalPTSP.Evaluate(afterMove, data );53 return AnalyticalPTSP.Evaluate(afterMove, data, CancellationToken.None); 53 54 } 54 55 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/Moves/TwoOpt/PTSPAnalyticalInversionMoveEvaluator.cs
r17253 r17320 20 20 #endregion 21 21 22 using System.Threading; 22 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; … … 50 51 var afterMove = (Permutation)tour.Clone(); 51 52 InversionManipulator.Apply(afterMove, move.Index1, move.Index2); 52 return AnalyticalPTSP.Evaluate(afterMove, data );53 return AnalyticalPTSP.Evaluate(afterMove, data, CancellationToken.None); 53 54 } 54 55
Note: See TracChangeset
for help on using the changeset viewer.