Fall 2003
Instructor Dr. Turgay Korkmaz
Homework 2 – programming (60 points)
Due by Sept 23, 2003 (5:30pm)
In this homework, you will implement a simulation program for the below system. You will use C programming language and the event-scheduling approach (so, you will implement everything including event lists, random number generator etc.).
System:
Assume that
Now, we are interested in determining the following performance measures under the below two design choices.
CHOICE-I: When a request arrives, dispatcher randomly selects one of the servers.
CHOICE-II: Dispatcher communicates with servers and learns the current queue length of each server every x seconds. Then, the dispatcher selects the server that has the shortest queue (if more than one server has the minimum queue length, then the dispatcher randomly selects one of the servers that have the minimum queue length).
For this choice, x could be10, 60, 120, 150, 200 sec.
Run your simulation program with different seeds (at least 3 times) for each design choice. Initially all queues are empty, terminate when 1000th customer departs.
For example,
Ø sim –ch 1 –s 345
Ø sim –ch 1 –s 123
Ø sim –ch 1 –s 583
….
Ø sim –ch 2 –x 50 –s 345
Ø sim –ch 2 –x 50 –s 123
Ø sim –ch 2 –x 50 –s 583
Based on the obtained results from your simulations:
a) Fill the following table
|
|
Average response time |
S1 utilization |
S2 utilization |
S2 utilization |
|
CHOICE-I Run1 Run2 Run3 |
|
|
|
|
|
CHOICE-II x=10 Run1 Run2 Run3 |
|
|
|
|
|
CHOICE-II x=20 Run1 Run2 Run3 |
|
|
|
|
|
CHOICE-II x=30 Run1 Run2 Run3 |
|
|
|
|
|
CHOICE-II x=40 Run1 Run2 Run3 |
|
|
|
|
|
CHOICE-II x=50 Run1 Run2 Run3 |
|
|
|
|
b) Draw the following graphs based on Run1
CHOICE-I Run1

…
CHOICE-I x=50 Run1

In
addition to the above table and figure, your report should include the
followings: