public void AddOrderOccurrence(Route OccurredIn) { OrderDayOccurrences |= OccurredIn.Day; UpdateOrderDayRestrictions(); }
public void RemoveOrderOccurrence(Route OccurredIn) { OrderDayOccurrences ^= (OrderDayOccurrences & OccurredIn.Day); UpdateOrderDayRestrictions(); }
public void RemoveRoute(Route toDelete) { if (AvailableRoutes.Contains(toDelete)) AvailableRoutes.Remove(toDelete); if (AllRoutes.Contains(toDelete)) AllRoutes.Remove(toDelete); }
public void RemoveRouteFromPlanning(Days day, int truckID, Route toRemove) { Tuple<Days, int, List<Route>> DayPlanning = TruckPlanning.Find(t => t.Item1 == day && t.Item2 == truckID); if (DayPlanning != null) { if (DayPlanning.Item3.Remove(toRemove)) { TravelTimeScore -= toRemove.TravelTime; foreach (Order order in toRemove.Orders) if (order.OrderNumber != 0) RemovePlannedOccurrence(order.OrderNumber, toRemove); toRemove.partOfSolution = null; AvailableRoutes.Add(toRemove); } } }
public void RemovePlannedOccurrence(int OrderNumber, Route OccurredIn) { if (OrderNumber == 0) return; OrderTracker counter = this.FindOrderTracker(OrderNumber); double before = counter.CurrentPenalty(); counter.PlannedDayOccurrences ^= (counter.PlannedDayOccurrences & OccurredIn.Day); counter.UpdateOrderDayRestrictions(); PenaltyScore += counter.CurrentPenalty() - before; }
public void AddRouteToPlanning(Days day, int truckID, Route toAdd) { Tuple<Days, int, List<Route>> DayPlanning = TruckPlanning.Find(t => t.Item1 == day && t.Item2 == truckID); if (DayPlanning != null) { DayPlanning.Item3.Add(toAdd); foreach (Order order in toAdd.Orders) if (order.OrderNumber != 0) AddPlannedOccurrence(order.OrderNumber, toAdd); AvailableRoutes.Remove(toAdd); TravelTimeScore += toAdd.TravelTime; toAdd.partOfSolution = this; } }
public void AddRoute(Route toAdd) { if (!AvailableRoutes.Contains(toAdd)) AvailableRoutes.Add(toAdd); if (!AllRoutes.Contains(toAdd)) AllRoutes.Add(toAdd); }
public void RemoveOrderOccurrence(Route OccurredIn) { OrderTracker.RemoveOrderOccurrence(OccurredIn); }
public void AddOrderOccurrence(Route OccurredIn) { OrderTracker.AddOrderOccurrence(OccurredIn); }