

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


ļ Hard copy of the homework must be submitted to the instructor in class and the soft copy must be sent to the TA ([email protected]) ) Superstore simulator: A common problem in superstore management is to assign the sufficient number of ācheck-outsā based on the estimated workload. To achieve this, statistical records about the number of customers are maintained. Note that this number may vary depending on the season, weekdays, and daytime. These figures are fed into a simulator to decide what is the minimum number of check-outs that must operate to guarantee a smooth workflow in the superstore (reduce waiting time, reduce queue length, increase check-out utilization, and so on). You are asked to implement this simulator based on the object oriented design principles you have learnt in the software engineering class. This project is a type of simulation and modeling problems that needs to be solved using software engineering design principles and tools. System entities: 1- Population of customers: This can be dynamic (as it really is in superstores, customers come and go every moment), or static. To simplify the problem, we will assume a fixed population at the beginning of simulation. This population is āconsumedā during the program life time, but never āproducedā, i.e. you start with a number of customers inside the superstore, it keeps shrinking, and no new customers arrive. The population size is a user input. 2- Customers: Each customer can purchase different number of items, so the serving time at the checkout may vary; let us assume a random number between 1 and 5 minutes, assigned to each customer with equal probability. 3- Servers: There are many servers; the maximum is 30 (limited by the superstore). The program shall ask for the number of servers before running the simulation (value in the range 1-30). 4- Customers queue: Most of the logic is implemented in this entity. It must be the āsmartā part of your program. The customers āarriveā to the queue in a uniform way (though this is not the case in reality). For example, if the population size is 1000, and the simulation runtime is 500 units, the queue will admit two new customers every time unit. The customers queue must assign customers to empty servers. If there is no empty servers, customers have to wait in the queue. This organization is a Single-Queue-Multiple-Servers system.
Simulation workflow: 1- Upon starting the program, the user shall be asked to enter the simulation parameters, which are: a) Population size b) Simulation time c) Number of servers (1-30) 2- The simulation runs āone-shotā, no need to detail every time slot (though it is nice to produce detailed log). The system will basically do the following in proper, timely manner: a. Pull customers from the population, and push them into the queue. b. Pull customers from the queue, push them into empty servers. c. Pull customers from the servers when they finish (1-5 time units for each). 3- Upon finishing the simulation, the system shall output some results that will help the superstore management to decide whether the number of servers is sufficient or not. These outputs are: a. Average waiting time for the customers b. Maximum waiting time c. Minimum waiting time d. Average server utilizations (amount of time the server is ābusyā divided by the total simulation time) Hint: A āTimerā is a built-in component found in every high-level programming language. It can be configured to fire a ātickā event after every fixed time interval. Consider using this component to drive your simulation. Usually, the simulation logic goes inside the tick event handler, you can check the population (to decide if you have to remove customers from there and push them into the queue), check the servers to see if any of them has finished processing the customer, so that you can free it and admit new customers if the queue is not empty.