[8813] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Diagnostics;
|
---|
| 4 | using System.Linq;
|
---|
| 5 | using HeuristicLab.Common;
|
---|
| 6 | using HeuristicLab.Core;
|
---|
| 7 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
| 8 | using HeuristicLab.Parameters;
|
---|
| 9 | using HeuristicLab.PDPSimulation.DomainModel;
|
---|
| 10 | using HeuristicLab.PDPSimulation.Operators;
|
---|
| 11 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 12 |
|
---|
| 13 | namespace HeuristicLab.PDPSimulation {
|
---|
| 14 | [Item("EarliestDueTimeDispatching", "")]
|
---|
| 15 | [StorableClass]
|
---|
| 16 | public class EarliestDueTimeDispatching : Dispatching {
|
---|
| 17 | [StorableConstructor]
|
---|
| 18 | protected EarliestDueTimeDispatching(bool deserializing) : base(deserializing) { }
|
---|
| 19 | protected EarliestDueTimeDispatching(EarliestDueTimeDispatching original, Cloner cloner) : base(original, cloner) { }
|
---|
| 20 | public EarliestDueTimeDispatching() {
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 24 | return new EarliestDueTimeDispatching(this, cloner);
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | protected override void GetHighestPriorityOrder(DynPDPProblemInstance instance, Vehicle vehicle, IEnumerable<Order> orders, out Order order, out double priority) {
|
---|
| 28 | order = orders.OrderBy(o => IsPickup(o, instance) ? o.PickupDueTime : o.DeliveryDueTime).First();
|
---|
| 29 | priority = - scenario.DistanceMeasure.GetDistance(vehicle.TargetPositionX, vehicle.TargetPositionY,
|
---|
| 30 | IsPickup(order, instance) ? order.PickupXCoord : order.DeliveryXCoord, IsPickup(order, instance) ? order.PickupYCoord : order.DeliveryYCoord);
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
| 33 | }
|
---|