Docsity

Homework - Engineering Software Design - Fall 2006 | EEL 4884, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
EEL 4884- Fall 2006
Homework
Due: November 15, 2005
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.
pf3

Partial preview of the text

Download Homework - Engineering Software Design - Fall 2006 | EEL 4884 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

EEL 4884- Fall 2006

Homework

Due: November 15, 2005

 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.