public Order(int OrderNumber, String Place, OrderFrequency Frequency, int NumberOfContainers, int VolumePerContainer, double EmptyingTimeInSeconds, int MatrixID, int X, int Y) { this.OrderNumber = OrderNumber; this.Place = Place; this.Frequency = Frequency; this.NumberOfContainers = NumberOfContainers; this.VolumePerContainer = VolumePerContainer; this.EmptyingTimeInSeconds = EmptyingTimeInSeconds; this.MatrixID = MatrixID; this.X = X; this.Y = Y; }
public Order(int OrderNumber, String Place, OrderFrequency Frequency, int NumberOfContainers, int VolumePerContainer, double EmptyingTimeInSeconds, int MatrixID, int X, int Y) { this.OrderNumber = OrderNumber; this.Place = Place; this.Frequency = Frequency; this.NumberOfContainers = NumberOfContainers; this.VolumePerContainer = VolumePerContainer; this.EmptyingTimeInSeconds = EmptyingTimeInSeconds; this.MatrixID = MatrixID; this.X = X; this.Y = Y; ClusterOrderIsLocatedIn = null; PenaltyTime = Convert.ToDouble(FrequencyNumber) * Convert.ToDouble(EmptyingTimeInSeconds) * 3.0d; DayRestrictions = DayRestrictionFactory.GetDayRestrictions(Frequency); OrderTracker = new OrderTracker(this, DayRestrictions); }
public static List<Days> GetDayRestrictions(OrderFrequency frequency) { switch (frequency) { case OrderFrequency.PWK1: return new List<Days>(new Days[] { Days.Monday, Days.Tuesday, Days.Wednesday, Days.Thursday, Days.Friday }); case OrderFrequency.PWK2: return new List<Days>(new Days[] { Days.Monday | Days.Thursday, Days.Tuesday | Days.Friday }); case OrderFrequency.PWK3: return new List<Days>(new Days[] { Days.Monday | Days.Wednesday | Days.Friday }); case OrderFrequency.PWK4: return new List<Days>(new Days[] { Days.Monday | Days.Tuesday | Days.Wednesday | Days.Thursday, Days.Monday | Days.Tuesday | Days.Wednesday | Days.Friday, Days.Monday | Days.Tuesday | Days.Thursday | Days.Friday, Days.Monday | Days.Wednesday | Days.Thursday | Days.Friday, Days.Tuesday | Days.Wednesday | Days.Thursday | Days.Friday }); case OrderFrequency.PWK5: return new List<Days>(new Days[] { Days.Monday | Days.Tuesday | Days.Wednesday | Days.Thursday | Days.Friday }); } return null; }
private List<Order> findOrdersWithFrequencyRandomly(OrderFrequency toLookFor, int maxAdditions) { int numAdditions = 0; List<Order> toReturn = new List<Order>(); Random random = new Random(); for (int i = 0; i < allOrders.Count; i++) { Order order = allOrders.ElementAt(random.Next(allOrders.Count)).Value; if (order.Frequency == toLookFor) { if (numAdditions > maxAdditions) return toReturn; else if (!toReturn.Contains(order)) { toReturn.Add(order); numAdditions++; } } } return toReturn; }
private List<Order> findOrdersWithFrequency(OrderFrequency toLookFor) { List<Order> toReturn = new List<Order>(); foreach (Order order in allOrders.Values) if (order.Frequency == toLookFor) toReturn.Add(order); return toReturn; }