Homework 1: Discrete-Event Simulation

Assignment given: September 2
Due Date: September 23, by 7pm

Hints, Partial solution, Suggested format of Log File, Directions for mailing homework to Lab Instructor,

Write in C a program to do the discrete-event simulation of a computer system. We assume that there is a CPU and two disks as represented in the following queueing network:


                    ----+       +--+        SWITCH
 INPUT ---->x------->||||------>|  |--------->x-----> OUTPUT
            ^       ----+       +--+         /|
            |       QUEUE1     SERVER1      / |
            |                   (CPU)      |  |
            |                              |  |
            |   +--+     +----             v  |
            x---|  |<----||||<-------------+  |
            ^   +--+     +----                | 
            |  SERVER2   QUEUE2               |
            |  (Disk1)                        |
            |                                 |
            |   +--+     +----                v
            x---|  |<----||||<----------------+
                +--+     +----
               SERVER3   QUEUE3
               (Disk2)
                

SERVER1 is the CPU and SERVER2 and SERVER3 are respectively the first and second disks. Each server is preceded by a queue where pending jobs wait if the server is busy.

The user is asked at run time to specify:

Instead of reading the values of SEED, INITTIME, .. at the terminal from the user, you may consider reading them from a file.

Print out the values of SEED, INITTIME, ..

Determine and print out:

Run the program a number of times with different values for the parameters and random seed. Examine in correspondence the utilizations and queue sizes. If for a given choice of parameters by changing the random seed we obtain utilization and size values that are stable [i.e. do not change much, say, change at most 10%], then we have a good simulation.

Mail the homework to the TA [instructions] Be sure to receive within 24 hours a message back from the TA confirming that he has received the homework. If you do not receive that reply contact both the instructor and the TA.

ingargiola@cis.temple.edu