Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Length (in minutes) of the simulation (int, user must enter a number >= 10)
- Number of customers expected to enter the store during each hour (integer between 1 and 60)
- If customers are ready to check out (when their checkOutArrivalTime == simulation clock)
- Remove the customer from the customer list and add the customer to cashier with shortest checkout line. Keep in mind more than one customer could be ready to check out during each clock cycle.
- Update cashiers. For each cashier:
- If the cashier’s finishTime <= simulation clock, the cashier is available to handle another customer from the queue. If that cashier’s line is not empty:
- Call the serveNextCustomer method for that cashier
- Increment number of customers served
- Calculate how long this customer was waiting since entering the checkout line and increment totalWaitTime accordingly.
- Output the customer details to the details output file.
- Number of customers waiting in a checkout line but not yet being served
- Number of customers who have been or are currently being served by cashiers
- Average wait time for all customers who have been or are currently being served (rounded to two places to the right of the decimal)
- If the number is less than or equal to the arrivalProbability, assume a new customer has arrived.
- If the number is greater than the arrivalProbability, no customer has arrived.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement