Index: branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Operators/DialARideEvaluator.cs
===================================================================
--- branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Operators/DialARideEvaluator.cs	(revision 8779)
+++ branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Operators/DialARideEvaluator.cs	(revision 8782)
@@ -143,5 +143,5 @@
         //check if it was serviced on time
         if (time > dueTime[endIndex])
-          tardiness += time - dueTime[endIndex];
+          tardiness += Math.Min(1000000, Math.Pow((vrptw.TardinessPenalty.Value * Math.E), (time - dueTime[endIndex])) - 1.0);
 
         //wait
@@ -220,5 +220,5 @@
       (eval as CVRPTWEvaluation).TravelTime += time;
 
-      penalty = tardiness * vrptw.TardinessPenalty.Value;
+      penalty = tardiness;
       eval.Penalty += penalty;
       eval.Quality += penalty;
Index: branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Optimizers/LocalUpdate/PriorityDispatching.cs
===================================================================
--- branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Optimizers/LocalUpdate/PriorityDispatching.cs	(revision 8779)
+++ branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Optimizers/LocalUpdate/PriorityDispatching.cs	(revision 8782)
@@ -37,5 +37,5 @@
       Parameters.Add(new ValueLookupParameter<RealVector>("Weights", "The weights for the individual priorities."));
       WeightsParameter.Value = new RealVector(new double[] {
-         100.000, 100.000,  22.349,  74.573,  18.424,  28.913,   0.331,  91.323,  36.969,  44.992,  64.892,  30.736,  23.113,  36.458,   6.178,  99.065,
+         100.000, 100.000,  22.349,  74.573,  18.424,  28.913,   0.331,  91.323,  36.969,  44.992,  64.892,  30.736,  23.113,  36.458,   6.178,  99.065, 100.0, 100.0
       });
     }
@@ -53,5 +53,6 @@
         var tmp = new Dictionary<Vehicle, Tuple<Order, double>>();
         foreach (var vehicle in waitingVehicles) {
-          var orders = waitingOrders.Concat(GetOrders().Where(x => x.OrderState == OrderState.PickedUp && x.AssignedVehicle == vehicle.Id));
+          var pickedupOrders = GetOrders().Where(x => x.OrderState == OrderState.PickedUp && x.AssignedVehicle == vehicle.Id);
+          var orders = waitingOrders.Concat(pickedupOrders);
           if (orders.Any()) {
             Order selectedOrder;
@@ -66,11 +67,36 @@
           var order = a.Key;
 
+          bool first = true;
+
+          XY target;
           MoveVehicleAction action;
           if (order.OrderState == OrderState.Waiting) {
+            target = new XY(order.PickupXCoord, order.PickupYCoord);
             action = new MoveVehicleAction(bestVehicle.Id, order.PickupXCoord, order.PickupYCoord, VehicleAction.Pickup, order, scenario.AllowDiversion, scenario.DistanceMeasure);
           } else {
+            target = new XY(order.DeliveryXCoord, order.DeliveryYCoord);
             action = new MoveVehicleAction(bestVehicle.Id, order.DeliveryXCoord, order.DeliveryYCoord, VehicleAction.Deliver, order, scenario.AllowDiversion, scenario.DistanceMeasure);
           }
-          SetAction(action);
+          var pickedupOrders = GetOrders().Where(x => x.OrderState == OrderState.PickedUp && x.AssignedVehicle == bestVehicle.Id);
+          var pickedupOrdersAtDestination = pickedupOrders.Where(o => o.DeliveryXCoord == target.X && o.DeliveryYCoord == target.Y);
+          List<MoveVehicleAction> deliveryActions = new List<MoveVehicleAction>();
+          foreach (var pickedupOrder in pickedupOrdersAtDestination) {
+            if (pickedupOrder != order) {
+              MoveVehicleAction deliveryAction = new MoveVehicleAction(bestVehicle.Id, pickedupOrder.DeliveryXCoord, pickedupOrder.DeliveryYCoord, VehicleAction.Deliver, pickedupOrder, scenario.AllowDiversion, scenario.DistanceMeasure);
+              if (first) {
+                SetAction(deliveryAction);
+                first = false;
+              } else {
+                AppendAction(deliveryAction);
+              }
+            }
+          }
+
+          if (first) {
+            SetAction(action);
+            first = false;
+          } else {
+            AppendAction(action);
+          }
           waitingVehicles.Remove(bestVehicle);
           waitingOrders.Remove(order);
@@ -94,53 +120,68 @@
                                    .ToDictionary(x => new XY(x.Key.X, x.Key.Y), y => y.ToArray(), new XYEqComparer());
       var deliveryOrdersByLocation = (from o in orders
-                                      where !IsPickup(o, instance)
+                                      where !IsPickup(o, instance) && o.Vehicle == vehicle.Id
                                       group o by new { X = o.DeliveryXCoord, Y = o.DeliveryYCoord })
                                       .ToDictionary(x => new XY(x.Key.X, x.Key.Y), y => y.ToArray(), new XYEqComparer());
-      var destinations = deliveryOrdersByLocation.Keys.ToArray();// vehicle.PickedUpOrders.Select(x => GetOrder(x)).Select(x => new XY(x.DeliveryXCoord, x.DeliveryYCoord)).ToArray();
+      var destinations = deliveryOrdersByLocation.Keys.ToArray();
       foreach (var o in orders) {
         if (IsPickup(o, instance) && o.Demand > vehicle.Capacity) continue;
         
-        var target = new XY(o.PickupXCoord, o.PickupYCoord);
-        if (!IsPickup(o, instance)) target = new XY(o.DeliveryXCoord, o.DeliveryYCoord);
-
-        var destinationDifference = destinations.Select(x => scenario.DistanceMeasure.GetDistance(target.X, target.Y, x.X, x.Y)).ToArray();
-        var courierDifference = GetVehicles().Where(x => x != vehicle).Select(x => new XY(x.TargetPositionX, x.TargetPositionY))
-          .Select(x => scenario.DistanceMeasure.GetDistance(target.X, target.Y, x.X, x.Y)).ToArray();
-
-        var variables = new Dictionary<string, double>();
-        variables.Add("Distance", scenario.DistanceMeasure.GetDistance(vehicle.TargetPositionX, vehicle.TargetPositionY, target.X, target.Y));
-        variables.Add("EarliestTimeOfArrival", vehicle.ReadyTime + variables["Distance"]); // scenario.DistanceMeasure.GetDistance(vehicle.TargetPositionX, vehicle.TargetPositionY, target.X, target.Y));
-        variables.Add("DueDate", o.DeliveryDueTime - GetSimulationTime());
-        variables.Add("StartDate", IsPickup(o, instance) ? o.PickupReadyTime - GetSimulationTime() : 0);
-        variables.Add("PickupOrdersAtTarget", pickupOrdersByLocation.ContainsKey(target) ? pickupOrdersByLocation[target].Count() : 0);
-        variables.Add("PickupOrderItemsAtTarget", pickupOrdersByLocation.ContainsKey(target) ? pickupOrdersByLocation[target].Sum(x => x.Demand) : 0);
-        variables.Add("DeliveryOrdersAtTarget", deliveryOrdersByLocation.ContainsKey(target) ? deliveryOrdersByLocation[target].Count() : 0);
-        variables.Add("DeliveryOrderItemsAtTarget", deliveryOrdersByLocation.ContainsKey(target) ? deliveryOrdersByLocation[target].Sum(x => x.Demand) : 0);
-        variables.Add("AverageDistanceToDestinations", destinationDifference.Any() ? destinationDifference.Average() : 0);
-        variables.Add("MinimumDistanceToDestinations", destinationDifference.Any() ? destinationDifference.Min() : 0);
-        variables.Add("MaximumDistanceToDestinations", destinationDifference.Any() ? destinationDifference.Max() : 0);
-        variables.Add("NumberOfOtherCouriersToTarget", GetVehicles().Count > 2 ? GetVehicles().Where(x => x != vehicle).Count(x => target.X == x.TargetPositionX && target.Y == x.TargetPositionY) : 0);
-        variables.Add("AverageDistanceToOtherCouriers", courierDifference.Any() ? courierDifference.Average() : 0);
-        variables.Add("MinimumDistanceToOtherCouriers", courierDifference.Any() ? courierDifference.Min() : 0);
-        variables.Add("MaximumDistanceToOtherCouriers", courierDifference.Any() ? courierDifference.Max() : 0);
-        variables.Add("DemandSize", o.Demand);
-
-        var prio =
-            weights[0] * variables["DueDate"]
-          + weights[1] * variables["StartDate"]
-          + weights[2] * variables["PickupOrdersAtTarget"]
-          + weights[3] * variables["Distance"]
-          + weights[4] * variables["AverageDistanceToDestinations"]
-          + weights[5] * variables["MinimumDistanceToDestinations"]
-          + weights[6] * variables["MaximumDistanceToDestinations"]
-          + weights[7] * variables["NumberOfOtherCouriersToTarget"]
-          + weights[8] * variables["AverageDistanceToOtherCouriers"]
-          + weights[9] * variables["EarliestTimeOfArrival"]
-          + weights[10] * variables["DeliveryOrdersAtTarget"]
-          + weights[11] * variables["PickupOrderItemsAtTarget"]
-          + weights[12] * variables["DeliveryOrderItemsAtTarget"]
-          + weights[13] * variables["MinimumDistanceToOtherCouriers"]
-          + weights[14] * variables["MaximumDistanceToOtherCouriers"]
-          + weights[15] * variables["DemandSize"];
+         double prio;
+         if (!IsPickup(o, instance) && vehicle.TargetPositionX == o.DeliveryXCoord && vehicle.TargetPositionY == o.DeliveryYCoord) {
+           prio = double.MaxValue;
+         } else {
+           var target = new XY(o.PickupXCoord, o.PickupYCoord);
+           if (!IsPickup(o, instance)) target = new XY(o.DeliveryXCoord, o.DeliveryYCoord);
+
+           var destinationDifference = destinations.Select(x => scenario.DistanceMeasure.GetDistance(o.DeliveryXCoord, o.DeliveryYCoord, x.X, x.Y)).ToArray();
+           var courierDifference = GetVehicles().Where(x => x != vehicle).Select(x => new XY(x.TargetPositionX, x.TargetPositionY))
+             .Select(x => scenario.DistanceMeasure.GetDistance(target.X, target.Y, x.X, x.Y)).ToArray();
+
+           var commonDestinations = orders.Where(x => !IsPickup(x, instance) && x.Vehicle == vehicle.Id &&
+                                    x.DeliveryXCoord == o.PickupXCoord &&
+                                    x.DeliveryYCoord == o.PickupYCoord);
+
+           var variables = new Dictionary<string, double>();
+           variables.Add("Distance", scenario.DistanceMeasure.GetDistance(vehicle.TargetPositionX, vehicle.TargetPositionY, target.X, target.Y));
+           variables.Add("EarliestTimeOfArrival", vehicle.ReadyTime + variables["Distance"]);
+           variables.Add("DueDate", o.DeliveryDueTime - GetSimulationTime());
+           variables.Add("StartDate", IsPickup(o, instance) ? o.PickupReadyTime - GetSimulationTime() : 0);
+           variables.Add("PickupOrdersAtTarget", pickupOrdersByLocation.ContainsKey(target) ? pickupOrdersByLocation[target].Count() : 0);
+           variables.Add("PickupOrderItemsAtTarget", pickupOrdersByLocation.ContainsKey(target) ? pickupOrdersByLocation[target].Sum(x => x.Demand) : 0);
+           variables.Add("DeliveryOrdersAtTarget", deliveryOrdersByLocation.ContainsKey(target) ? deliveryOrdersByLocation[target].Count() : 0);
+           variables.Add("DeliveryOrderItemsAtTarget", deliveryOrdersByLocation.ContainsKey(target) ? deliveryOrdersByLocation[target].Sum(x => x.Demand) : 0);
+           variables.Add("AverageDistanceToDestinations", destinationDifference.Any() ? destinationDifference.Average() : 0);
+           variables.Add("MinimumDistanceToDestinations", destinationDifference.Any() ? destinationDifference.Min() : 0);
+           variables.Add("MaximumDistanceToDestinations", destinationDifference.Any() ? destinationDifference.Max() : 0);
+           variables.Add("NumberOfOtherCouriersToTarget", GetVehicles().Count > 2 ? GetVehicles().Where(x => x != vehicle).Count(x => target.X == x.TargetPositionX && target.Y == x.TargetPositionY) : 0);
+           variables.Add("AverageDistanceToOtherCouriers", courierDifference.Any() ? courierDifference.Average() : 0);
+           variables.Add("MinimumDistanceToOtherCouriers", courierDifference.Any() ? courierDifference.Min() : 0);
+           variables.Add("MaximumDistanceToOtherCouriers", courierDifference.Any() ? courierDifference.Max() : 0);
+           variables.Add("DemandSize", o.Demand);
+           variables.Add("Slack", o.DeliveryDueTime - GetSimulationTime()
+             - (vehicle.ReadyTime + variables["Distance"] +
+                (IsPickup(o, instance) ? (o.PickupServiceTime + scenario.DistanceMeasure.GetDistance(o.PickupXCoord, o.PickupYCoord, o.DeliveryXCoord, o.DeliveryYCoord)) : 0)));
+           variables.Add("EDD", commonDestinations.Any() ? commonDestinations.Min(d => d.DeliveryDueTime - GetSimulationTime()) : 0);
+
+           prio =
+               weights[0] * variables["DueDate"]
+             + weights[1] * variables["StartDate"]
+             + weights[2] * variables["PickupOrdersAtTarget"]
+             + weights[3] * variables["Distance"]
+             + weights[4] * variables["AverageDistanceToDestinations"]
+             + weights[5] * variables["MinimumDistanceToDestinations"]
+             + weights[6] * variables["MaximumDistanceToDestinations"]
+             + weights[7] * variables["NumberOfOtherCouriersToTarget"]
+             + weights[8] * variables["AverageDistanceToOtherCouriers"]
+             + weights[9] * variables["EarliestTimeOfArrival"]
+             + weights[10] * variables["DeliveryOrdersAtTarget"]
+             + weights[11] * variables["PickupOrderItemsAtTarget"]
+             + weights[12] * variables["DeliveryOrderItemsAtTarget"]
+             + weights[13] * variables["MinimumDistanceToOtherCouriers"]
+             + weights[14] * variables["MaximumDistanceToOtherCouriers"]
+             + weights[15] * variables["DemandSize"]
+             + weights[16] * variables["Slack"]
+             + weights[17] * variables["EDD"];
+         }
 
         if (prio > bestPriority) {
Index: branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/PickupDeliveryAnalyzer.cs
===================================================================
--- branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/PickupDeliveryAnalyzer.cs	(revision 8779)
+++ branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/PickupDeliveryAnalyzer.cs	(revision 8782)
@@ -211,4 +211,6 @@
 
         results.Add(new Result("LeadTime", new DoubleValue()));
+
+        results.Add(new Result("TardinessPenalty", new DoubleValue()));
       }
 
@@ -250,4 +252,12 @@
 
       results["TimeHistogram"].Value = timeHistogram;
+
+      double tardiness = 0;
+      foreach(Order o in simulation.Orders) {
+        if(o.Tardiness > 0) {
+          tardiness += Math.Min(1000000, Math.Pow((scenario.TardinessPenaltyParameter.Value.Value * Math.E), o.Tardiness) - 1.0);
+        }
+      }
+      (results["TardinessPenalty"].Value as DoubleValue).Value = tardiness;
     }
 
