public override void Execute(List <Event> scheduler, Restaurant restaurant, int[] parameters) { ConditionalEvents.SortingByConsumptionTime(restaurant.buffetGuests); Console.WriteLine("### Wydarzenie: klient o ID {0} kończy konsumpcję w Bufecie. Trafia do kolejki do kasy ###", restaurant.buffetGuests[0].ID); Client temp = restaurant.buffetGuests[0]; switch (temp.AmountPeople) { case 1: restaurant.BuffetStands++; break; case 2: restaurant.BuffetStands += 2; break; case 3: restaurant.BuffetStands += 3; break; case 4: restaurant.BuffetStands += 4; break; } restaurant.cashRegisterQ.Enqueue(temp); restaurant.buffetGuests.RemoveAt(0); }
public override void Execute(List <Event> scheduler, Restaurant restaurant, int[] parameters) { ConditionalEvents.SortingByConsumptionTime(restaurant.drinkGroup); Console.WriteLine("### Wydarzenie: Klienci o ID {0} otrzymali napoje. ###", restaurant.drinkGroup[0].ID); Console.WriteLine("Kelner jest wolny"); Client temp = restaurant.drinkGroup[0]; restaurant.mealsQ.Enqueue(temp); restaurant.drinkGroup.RemoveAt(0); restaurant.Waiters++; }
public override void Execute(List <Event> scheduler, Restaurant restaurant, int[] parameters) { var time = (int)Generators.Exponential(1900, ref Generators.Seeds[1]); ConditionalEvents.SortingByConsumptionTime(restaurant.mealGroup); Console.WriteLine("### Wydarzenie: Klienci o ID {0} dostali jedzenie. Smacznego. ###", restaurant.mealGroup[0].ID); Console.WriteLine("Kelner jest wolny"); Client temp = restaurant.mealGroup[0]; restaurant.consumptionGroup.Add(temp); restaurant.mealGroup.RemoveAt(0); temp.ConsumptionTime = SystemTime + time; restaurant.Waiters++; scheduler.Add(new Consumption(SystemTime + time, "Consumption")); SortingScheduler(scheduler); }
public override void Execute(List <Event> scheduler, Restaurant restaurant, int[] parameters) { ConditionalEvents.SortingByConsumptionTime(restaurant.consumptionGroup); Console.WriteLine("### Wydarzenie: Klienci o ID {0} zjedli swoj posiłek. Poszli do kasy ###", restaurant.consumptionGroup[0].ID); Client temp = restaurant.consumptionGroup[0]; switch (temp.Table) { case 2: restaurant.TwoSeat++; break; case 3: restaurant.ThreeSeat++; break; case 4: restaurant.FourSeat++; break; } restaurant.consumptionGroup.RemoveAt(0); restaurant.cashRegisterQ.Enqueue(temp); }