public void AddOrderOccurrence(Route OccurredIn)
 {
     OrderDayOccurrences |= OccurredIn.Day;
     UpdateOrderDayRestrictions();
 }
 public void RemoveOrderOccurrence(Route OccurredIn)
 {
     OrderDayOccurrences ^= (OrderDayOccurrences & OccurredIn.Day);
     UpdateOrderDayRestrictions();
 }
Beispiel #3
0
 public void RemoveRoute(Route toDelete)
 {
     if (AvailableRoutes.Contains(toDelete))
         AvailableRoutes.Remove(toDelete);
     if (AllRoutes.Contains(toDelete))
         AllRoutes.Remove(toDelete);
 }
Beispiel #4
0
        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);
                }
            }
        }
Beispiel #5
0
        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;
        }
Beispiel #6
0
        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;
            }
        }
Beispiel #7
0
 public void AddRoute(Route toAdd)
 {
     if (!AvailableRoutes.Contains(toAdd))
         AvailableRoutes.Add(toAdd);
     if (!AllRoutes.Contains(toAdd))
         AllRoutes.Add(toAdd);
 }
Beispiel #8
0
 public void RemoveOrderOccurrence(Route OccurredIn)
 {
     OrderTracker.RemoveOrderOccurrence(OccurredIn);
 }
Beispiel #9
0
 public void AddOrderOccurrence(Route OccurredIn)
 {
     OrderTracker.AddOrderOccurrence(OccurredIn);
 }