- Timestamp:
- 12/18/19 16:11:21 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs
r17335 r17382 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Encodings.PermutationEncoding; 27 using HeuristicLab.Optimization; 27 28 28 29 namespace HeuristicLab.Problems.PTSP { … … 60 61 } 61 62 62 public override double Evaluate(Permutation tour, IRandom random, CancellationToken cancellationToken) { 63 return Evaluate(tour, ProbabilisticTSPData, cancellationToken); 63 public override ISingleObjectiveEvaluationResult Evaluate(Permutation tour, IRandom random, CancellationToken cancellationToken) { 64 var quality = Evaluate(tour, ProbabilisticTSPData, cancellationToken); 65 return new SingleObjectiveEvaluationResult(quality); 64 66 } 65 67 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs
r17335 r17382 29 29 using HeuristicLab.Data; 30 30 using HeuristicLab.Encodings.PermutationEncoding; 31 using HeuristicLab.Optimization; 31 32 using HeuristicLab.Parameters; 32 33 using HeuristicLab.Problems.Instances; … … 56 57 set { RealizationsParameter.Value.Value = value; } 57 58 } 58 59 59 60 private ReadOnlyItemList<BoolArray> RealizationData { 60 61 get { return RealizationDataParameter.Value; } … … 102 103 } 103 104 104 public override double Evaluate(Permutation tour, IRandom random, CancellationToken cancellationToken) { 105 return Evaluate(tour, ProbabilisticTSPData, RealizationData, cancellationToken); 105 public override ISingleObjectiveEvaluationResult Evaluate(Permutation tour, IRandom random, CancellationToken cancellationToken) { 106 var quality = Evaluate(tour, ProbabilisticTSPData, RealizationData, cancellationToken); 107 return new SingleObjectiveEvaluationResult(quality); 106 108 } 107 109 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/ProbabilisticTSP.cs
r17363 r17382 124 124 try { 125 125 var tour = new Permutation(PermutationTypes.RelativeUndirected, data.BestKnownTour); 126 var tourLength = Evaluate(tour, new MersenneTwister(1)) ;126 var tourLength = Evaluate(tour, new MersenneTwister(1)).Quality; 127 127 BestKnownSolution = ProbabilisticTSPData.GetSolution(tour, tourLength); 128 128 BestKnownQuality = tourLength;
Note: See TracChangeset
for help on using the changeset viewer.