Class Waiter
java.lang.Object
simu.model.Waiter
Waiter class that takes orders from the Customer and delivers them to the Kitchen.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculatePrepTime(List<Customer> group) Calculate the preparation time for the group of customers.deliverOrder(Customer customer) Delivers the order from the Kitchen to the Customer.voidOrder from the customer to be sent to the Kitchen.
-
Constructor Details
-
Waiter
Constructor for Waiter.- Parameters:
kitchen- Link between Waiter and Kitchen.
-
-
Method Details
-
takeOrder
-
deliverOrder
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
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.
-