Changeset 11320 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Creators/GreedyOrienteeringTourCreator.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/Creators/GreedyOrienteeringTourCreator.cs
r11319 r11320 55 55 get { return (ILookupParameter<IntValue>)Parameters["TerminalPoint"]; } 56 56 } 57 public ILookupParameter<DoubleValue> FixedPenaltyParameter {58 get { return (ILookupParameter<DoubleValue>)Parameters[" FixedPenalty"]; }57 public ILookupParameter<DoubleValue> PointVisitingCostsParameter { 58 get { return (ILookupParameter<DoubleValue>)Parameters["PointVisitingCosts"]; } 59 59 } 60 60 #endregion … … 73 73 Parameters.Add(new LookupParameter<IntValue>("StartingPoint", "Index of the starting point.")); 74 74 Parameters.Add(new LookupParameter<IntValue>("TerminalPoint", "Index of the ending point.")); 75 Parameters.Add(new LookupParameter<DoubleValue>(" FixedPenalty", "The penalty for each visited vertex."));75 Parameters.Add(new LookupParameter<DoubleValue>("PointVisitingCosts", "The costs for visiting a point.")); 76 76 } 77 77 … … 85 85 int numPoints = ScoresParameter.ActualValue.Length; 86 86 var distances = DistanceMatrixParameter.ActualValue; 87 double fixedPenalty = FixedPenaltyParameter.ActualValue.Value;87 double pointVisitingCosts = PointVisitingCostsParameter.ActualValue.Value; 88 88 double maxDistance = MaximumDistanceParameter.ActualValue.Value; 89 89 var scores = ScoresParameter.ActualValue; … … 92 92 var feasiblePoints = ( 93 93 from point in Enumerable.Range(0, numPoints) 94 let distance = distances[startPoint, point] + distances[point, endPoint] + fixedPenalty94 let distance = distances[startPoint, point] + distances[point, endPoint] + pointVisitingCosts 95 95 let score = scores[point] 96 96 where distance <= maxDistance … … 115 115 for (int insertPosition = 1; insertPosition < tour.Count; insertPosition++) { 116 116 // Create the candidate tour 117 double detour = distances.CalculateInsertionCosts(tour, insertPosition, feasiblePoints[i], fixedPenalty);117 double detour = distances.CalculateInsertionCosts(tour, insertPosition, feasiblePoints[i], pointVisitingCosts); 118 118 119 119 // If the insertion would be feasible, perform it
Note: See TracChangeset
for help on using the changeset viewer.