Changeset 11320 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs
- Timestamp:
- 09/01/14 10:36:54 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs
r11319 r11320 58 58 get { return (ILookupParameter<IntValue>)Parameters["TerminalPoint"]; } 59 59 } 60 public ILookupParameter<DoubleValue> FixedPenaltyParameter {61 get { return (ILookupParameter<DoubleValue>)Parameters[" FixedPenalty"]; }60 public ILookupParameter<DoubleValue> PointVisitingCostsParameter { 61 get { return (ILookupParameter<DoubleValue>)Parameters["PointVisitingCosts"]; } 62 62 } 63 63 #region ILocalImprovementOperator Parameters … … 99 99 Parameters.Add(new LookupParameter<IntValue>("StartingPoint", "Index of the starting point.")); 100 100 Parameters.Add(new LookupParameter<IntValue>("TerminalPoint", "Index of the ending point.")); 101 Parameters.Add(new LookupParameter<DoubleValue>(" FixedPenalty", "The penalty for each visited vertex."));101 Parameters.Add(new LookupParameter<DoubleValue>("PointVisitingCosts", "The costs for visiting a point.")); 102 102 103 103 Parameters.Add(new ValueLookupParameter<IntValue>("LocalIterations", "The number of iterations that have already been performed.", new IntValue(0))); … … 119 119 var distances = DistanceMatrixParameter.ActualValue; 120 120 var scores = ScoresParameter.ActualValue; 121 double fixedPenalty = FixedPenaltyParameter.ActualValue.Value;121 double pointVisitingCosts = PointVisitingCostsParameter.ActualValue.Value; 122 122 double maxLength = MaximumDistanceParameter.ActualValue.Value; 123 123 int maxIterations = MaximumIterationsParameter.ActualValue.Value; … … 129 129 var tour = IntegerVectorParameter.ActualValue.ToList(); 130 130 131 double tourLength = distances.CalculateTourLength(tour, fixedPenalty);131 double tourLength = distances.CalculateTourLength(tour, pointVisitingCosts); 132 132 double tourScore = tour.Sum(point => scores[point]); 133 133 … … 148 148 // Determine if any of the visitable points can be included at any position within the tour 149 149 IncludeNewPoints(tour, visitablePoints, 150 distances, fixedPenalty, maxLength, scores,150 distances, pointVisitingCosts, maxLength, scores, 151 151 ref tourLength, ref tourScore, ref evaluations, ref optimizationDone); 152 152 … … 211 211 } 212 212 private void IncludeNewPoints(List<int> tour, List<int> visitablePoints, 213 DistanceMatrix distances, double fixedPenalty, double maxLength, DoubleArray scores,213 DistanceMatrix distances, double pointVisitingCosts, double maxLength, DoubleArray scores, 214 214 ref double tourLength, ref double tourScore, ref int evaluations, ref bool optimizationDone) { 215 215 … … 224 224 evaluations++; 225 225 226 double detour = distances.CalculateInsertionCosts(tour, tourPosition, visitablePoints[i], fixedPenalty);226 double detour = distances.CalculateInsertionCosts(tour, tourPosition, visitablePoints[i], pointVisitingCosts); 227 227 228 228 // Determine if including the point does not violate any constraint
Note: See TracChangeset
for help on using the changeset viewer.