Changeset 8787


Ignore:
Timestamp:
10/11/12 10:55:42 (10 years ago)
Author:
svonolfe
Message:

improved priority rule (#1955)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Optimizers/LocalUpdate/PriorityDispatching.cs

    r8782 r8787  
    9090                AppendAction(deliveryAction);
    9191              }
     92              waitingOrders.Remove(pickedupOrder);
    9293            }
    9394          }
     
    134135           if (!IsPickup(o, instance)) target = new XY(o.DeliveryXCoord, o.DeliveryYCoord);
    135136
    136            var destinationDifference = destinations.Select(x => scenario.DistanceMeasure.GetDistance(o.DeliveryXCoord, o.DeliveryYCoord, x.X, x.Y)).ToArray();
     137           var destinationDifference = destinations.Select(x => scenario.DistanceMeasure.GetDistance(target.X, target.Y, x.X, x.Y)).ToArray();
    137138           var courierDifference = GetVehicles().Where(x => x != vehicle).Select(x => new XY(x.TargetPositionX, x.TargetPositionY))
    138139             .Select(x => scenario.DistanceMeasure.GetDistance(target.X, target.Y, x.X, x.Y)).ToArray();
     
    159160           variables.Add("MaximumDistanceToOtherCouriers", courierDifference.Any() ? courierDifference.Max() : 0);
    160161           variables.Add("DemandSize", o.Demand);
    161            variables.Add("Slack", o.DeliveryDueTime - GetSimulationTime()
    162              - (vehicle.ReadyTime + variables["Distance"] +
    163                 (IsPickup(o, instance) ? (o.PickupServiceTime + scenario.DistanceMeasure.GetDistance(o.PickupXCoord, o.PickupYCoord, o.DeliveryXCoord, o.DeliveryYCoord)) : 0)));
    164            variables.Add("EDD", commonDestinations.Any() ? commonDestinations.Min(d => d.DeliveryDueTime - GetSimulationTime()) : 0);
     162           variables.Add("EDD", commonDestinations.Any() ? commonDestinations.Min(d => d.DeliveryDueTime
     163             - scenario.DistanceMeasure.GetDistance(vehicle.TargetPositionX, vehicle.TargetPositionY, d.DeliveryXCoord, d.DeliveryYCoord)
     164             - GetSimulationTime()) : 0);
     165           variables.Add("LeadTime", o.PickupReadyTime - GetSimulationTime());
    165166
    166167           prio =
     
    181182             + weights[14] * variables["MaximumDistanceToOtherCouriers"]
    182183             + weights[15] * variables["DemandSize"]
    183              + weights[16] * variables["Slack"]
    184              + weights[17] * variables["EDD"];
     184             + weights[16] * variables["EDD"]
     185             + weights[17] * variables["LeadTime"];
    185186         }
    186187
Note: See TracChangeset for help on using the changeset viewer.