Changeset 6797
- Timestamp:
- 09/19/11 14:30:17 (13 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveTabuCriterion.cs
r6773 r6797 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 115 116 PotvinPDRelocateMoveAttribute attribute = tabuMove as PotvinPDRelocateMoveAttribute; 116 117 117 if (!useAspiration || moveQuality >= attribute.MoveQuality) { 118 if ((attribute.City == move.City && attribute.Tour == move.Tour) || 118 double distance = 0; 119 if (MoveDistanceParameter.ActualValue != null) 120 distance = MoveDistanceParameter.ActualValue.Value; 121 122 double overload = 0; 123 if (MoveOverloadParameter.ActualValue != null) 124 overload = MoveOverloadParameter.ActualValue.Value; 125 126 double tardiness = 0; 127 if (MoveTardinessParameter.ActualValue != null) 128 tardiness = MoveTardinessParameter.ActualValue.Value; 129 130 IVRPProblemInstance instance = ProblemInstanceParameter.ActualValue; 131 double quality = attribute.Distance * instance.DistanceFactor.Value; 132 133 IHomogenousCapacitatedProblemInstance cvrp = instance as IHomogenousCapacitatedProblemInstance; 134 if (cvrp != null) 135 quality += attribute.Overload * cvrp.OverloadPenalty.Value; 136 137 ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance; 138 if (vrptw != null) 139 quality += attribute.Tardiness * vrptw.TardinessPenalty.Value; 140 141 if (!useAspiration || moveQuality >= quality) { 142 if ((attribute.City == move.City && attribute.Tour == move.Tour) || 119 143 (attribute.City == move.Replaced && attribute.Tour == move.OldTour)) { 120 144 isTabu = true; 121 145 break; 122 146 } 123 124 double distance = 0;125 if (MoveDistanceParameter.ActualValue != null)126 distance = MoveDistanceParameter.ActualValue.Value;127 128 double overload = 0;129 if (MoveOverloadParameter.ActualValue != null)130 overload = MoveOverloadParameter.ActualValue.Value;131 132 double tardiness = 0;133 if (MoveTardinessParameter.ActualValue != null)134 tardiness = MoveTardinessParameter.ActualValue.Value;135 147 136 148 if (attribute.Distance == distance && attribute.Overload == overload && attribute.Tardiness == tardiness) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveTabuCriterion.cs
r6773 r6797 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 115 116 PotvinPDRelocateMoveAttribute attribute = tabuMove as PotvinPDRelocateMoveAttribute; 116 117 117 if (!useAspiration || moveQuality >= attribute.MoveQuality) { 118 double distance = 0; 119 if (MoveDistanceParameter.ActualValue != null) 120 distance = MoveDistanceParameter.ActualValue.Value; 121 122 double overload = 0; 123 if (MoveOverloadParameter.ActualValue != null) 124 overload = MoveOverloadParameter.ActualValue.Value; 125 126 double tardiness = 0; 127 if (MoveTardinessParameter.ActualValue != null) 128 tardiness = MoveTardinessParameter.ActualValue.Value; 129 130 IVRPProblemInstance instance = ProblemInstanceParameter.ActualValue; 131 double quality = attribute.Distance * instance.DistanceFactor.Value; 132 133 IHomogenousCapacitatedProblemInstance cvrp = instance as IHomogenousCapacitatedProblemInstance; 134 if (cvrp != null) 135 quality += attribute.Overload * cvrp.OverloadPenalty.Value; 136 137 ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance; 138 if (vrptw != null) 139 quality += attribute.Tardiness * vrptw.TardinessPenalty.Value; 140 141 if (!useAspiration || moveQuality >= quality) { 118 142 if (attribute.City == move.City && attribute.Tour == move.Tour) { 119 143 isTabu = true; 120 144 break; 121 145 } 122 123 double distance = 0;124 if (MoveDistanceParameter.ActualValue != null)125 distance = MoveDistanceParameter.ActualValue.Value;126 127 double overload = 0;128 if (MoveOverloadParameter.ActualValue != null)129 overload = MoveOverloadParameter.ActualValue.Value;130 131 double tardiness = 0;132 if (MoveTardinessParameter.ActualValue != null)133 tardiness = MoveTardinessParameter.ActualValue.Value;134 146 135 147 if (attribute.Distance == distance && attribute.Overload == overload && attribute.Tardiness == tardiness) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveTabuCriterion.cs
r6773 r6797 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 115 116 PotvinPDRelocateMoveAttribute attribute = tabuMove as PotvinPDRelocateMoveAttribute; 116 117 117 if (!useAspiration || moveQuality >= attribute.MoveQuality) { 118 double distance = 0; 119 if (MoveDistanceParameter.ActualValue != null) 120 distance = MoveDistanceParameter.ActualValue.Value; 121 122 double overload = 0; 123 if (MoveOverloadParameter.ActualValue != null) 124 overload = MoveOverloadParameter.ActualValue.Value; 125 126 double tardiness = 0; 127 if (MoveTardinessParameter.ActualValue != null) 128 tardiness = MoveTardinessParameter.ActualValue.Value; 129 130 IVRPProblemInstance instance = ProblemInstanceParameter.ActualValue; 131 double quality = attribute.Distance * instance.DistanceFactor.Value; 132 133 IHomogenousCapacitatedProblemInstance cvrp = instance as IHomogenousCapacitatedProblemInstance; 134 if (cvrp != null) 135 quality += attribute.Overload * cvrp.OverloadPenalty.Value; 136 137 ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance; 138 if (vrptw != null) 139 quality += attribute.Tardiness * vrptw.TardinessPenalty.Value; 140 141 if (!useAspiration || moveQuality >= quality) { 118 142 if (attribute.City == move.City && attribute.Tour == move.Tour) { 119 143 isTabu = true; 120 144 break; 121 145 } 122 123 double distance = 0;124 if (MoveDistanceParameter.ActualValue != null)125 distance = MoveDistanceParameter.ActualValue.Value;126 127 double overload = 0;128 if (MoveOverloadParameter.ActualValue != null)129 overload = MoveOverloadParameter.ActualValue.Value;130 131 double tardiness = 0;132 if (MoveTardinessParameter.ActualValue != null)133 tardiness = MoveTardinessParameter.ActualValue.Value;134 146 135 147 if (attribute.Distance == distance && attribute.Overload == overload && attribute.Tardiness == tardiness) {
Note: See TracChangeset
for help on using the changeset viewer.