- Timestamp:
- 05/08/20 06:34:12 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj
r17525 r17526 90 90 <ItemGroup> 91 91 <Compile Include="Creators\GreedyOrienteeringTourCreator.cs" /> 92 <Compile Include="DistanceMatrix.cs" />93 92 <Compile Include="Improvers\OrienteeringLocalImprovementOperator.cs" /> 94 93 <Compile Include="Interfaces\IOrienteeringSolutionCreator.cs" /> -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs
r17525 r17526 110 110 var data = OrienteeringProblemData; 111 111 112 var best = GetBestSolution(vectors, qualities) ;113 var score = CalculateScore(OrienteeringProblemData, best .Item1);114 var travelCosts = CalculateTravelCosts(OrienteeringProblemData, best .Item1);112 var best = GetBestSolution(vectors, qualities).Item1; 113 var score = CalculateScore(OrienteeringProblemData, best); 114 var travelCosts = CalculateTravelCosts(OrienteeringProblemData, best); 115 115 var quality = CalculateQuality(OrienteeringProblemData, score, travelCosts); 116 116 117 if ( BestKnownQuality == double.NaN || best.Item2 > BestKnownQuality) {118 BestKnownQuality = best.Item2;119 BestKnownSolutionParameter.ActualValue = data.GetSolution((IntegerVector)best. Item1.Clone(), quality, score, travelCosts);117 if (double.IsNaN(BestKnownQuality) || IsBetter(quality, BestKnownQuality)) { 118 BestKnownQuality = quality; 119 BestKnownSolutionParameter.ActualValue = data.GetSolution((IntegerVector)best.Clone(), quality, score, travelCosts); 120 120 } 121 121 122 122 var bestSoFar = BestOrienteeringSolutionParameter.ActualValue; 123 123 124 if (bestSoFar == null ) {125 bestSoFar = data.GetSolution((IntegerVector)best. Item1.Clone(), quality, score, travelCosts);124 if (bestSoFar == null || IsBetter(quality, bestSoFar.Quality.Value)) { 125 bestSoFar = data.GetSolution((IntegerVector)best.Clone(), quality, score, travelCosts); 126 126 BestOrienteeringSolutionParameter.ActualValue = bestSoFar; 127 } else {128 if (IsBetter(best.Item2, bestSoFar.Quality.Value)) {129 bestSoFar.Route = (IntegerVector)best.Item1.Clone();130 bestSoFar.Quality.Value = quality;131 bestSoFar.Score.Value = score;132 bestSoFar.TravelCosts.Value = travelCosts;133 }134 127 } 135 128 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringSolution.cs
r17525 r17526 101 101 : base(original, cloner) { 102 102 this.route = cloner.Clone(original.route); 103 this.routeAsPermutation = cloner.Clone(original.routeAsPermutation); 103 104 this.opData = cloner.Clone(original.opData); 104 105 this.quality = cloner.Clone(original.quality); … … 110 111 : base() { 111 112 this.route = route; 113 this.routeAsPermutation = new Permutation(PermutationTypes.RelativeDirected, route); 112 114 this.opData = opData; 113 115 this.quality = quality;
Note: See TracChangeset
for help on using the changeset viewer.