- Timestamp:
- 07/30/14 12:46:32 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs
r11228 r11237 93 93 } 94 94 #endregion 95 public ILookupParameter<DoubleValue> QualityParameter { 96 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 97 } 95 98 #endregion 96 99 … … 114 117 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated moves.")); 115 118 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The name of the collection where the results are stored.")); 119 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value of the solution.")); 116 120 } 117 121 … … 146 150 // Determine if any of the visitable points can be included at any position within the tour 147 151 IncludeNewPoints(tour, visitablePoints, 148 distances, fixedPenalty, maxLength, 149 ref tourLength, ref optimizationDone);152 distances, fixedPenalty, maxLength, scores, 153 ref tourLength, ref tourScore, ref optimizationDone); 150 154 151 155 // Determine if any of the visitable points can take the place of an already visited point in the tour to improve the scores … … 157 161 // Set new tour 158 162 IntegerVectorParameter.ActualValue = new IntegerVector(tour.ToArray()); 163 QualityParameter.ActualValue.Value = tourScore; 159 164 160 165 return base.Apply(); … … 201 206 } 202 207 private void IncludeNewPoints(List<int> tour, List<int> visitablePoints, 203 DistanceMatrix distances, double fixedPenalty, double maxLength, 204 ref double tourLength, ref bool optimizationDone) {208 DistanceMatrix distances, double fixedPenalty, double maxLength, DoubleArray scores, 209 ref double tourLength, ref double tourScore, ref bool optimizationDone) { 205 210 206 211 for (int tourPosition = 1; tourPosition < tour.Count; tourPosition++) { … … 219 224 tour.Insert(tourPosition, visitablePoints[i]); 220 225 221 // Update the overall tour tourLength 226 // Update the overall tour tourLength and score 222 227 tourLength += detour; 228 tourScore += scores[visitablePoints[i]]; 223 229 224 230 // Re-run this optimization
Note: See TracChangeset
for help on using the changeset viewer.