Class Waiter

java.lang.Object
simu.model.Waiter

public class Waiter extends Object
Waiter class that takes orders from the Customer and delivers them to the Kitchen.
See Also:
  • Constructor Details

    • Waiter

      public Waiter(Kitchen kitchen)
      Constructor for Waiter.
      Parameters:
      kitchen - Link between Waiter and Kitchen.
  • Method Details

    • takeOrder

      public void takeOrder(MenuItem item, Customer customer)
      Order from the customer to be sent to the Kitchen.
      Parameters:
      item - MenuItem order from the Customer to be sent to the Kitchen.
      customer - Customer who made the order.
    • deliverOrder

      public List<MenuItem> deliverOrder(Customer customer)
      Delivers the order from the Kitchen to the Customer. Adds the time it took to make the meal for the simulation time.
      Parameters:
      customer - Customer who needs to be served.
      Returns:
      List of ordered MenuItems. Used if the Customer has multiple orders.
    • calculatePrepTime

      public double calculatePrepTime(List<Customer> group)
      Calculate the preparation time for the group of customers. Favours the groups with fewer customers, because of smaller chance of having to wait for extra orders.
      Parameters:
      group - List of customers in the group.
      Returns:
      Maximum preparation time for the group.