CIS4307 - Homework 1: Discrete-Event Simulation

Assignment given: September 2, 2008
Due Date: September 22, by 10pm

Hints, Suggested format of Log File,

Write in C a program to do the discrete-event simulation of a computer system. We assume that the system can be represented as the following queueing network:

               ---+     +-+ SWITCH1           
  INPUT-->x---->|||---->| |--->x-------------->OUTPUT
          ^    ---+     +-+    |
          |   QUEUE1    CPU    |
          |    +-+    +---     V 
          +<---| |<---|||<-----x SWITCH2      
          |    +-+    +---     | 
	  |   DISK1   QUEUE2   |
          |    +-+    +---     | 
          +<---| |<---|||<-----+      
               +-+    +---      
	      DISK2   QUEUE3   
To this system arrive jobs. When a job is received at the CPU it spends some time on the it, then either the job completes or it continues at one of two disks, after which it returns to the CPU. Execution of the job continues in this way until it leaves the system.

The program will read from a file, sim.init, the following values:

Write to a log file, sim.log, each significant event [the significant events are the arrival of a new job into the system, the completion of a job at a server, the termination of the simulation]. [Here is the suggested format for the log 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.

Your program should process a reasonable number of jobs, at least one thousand.

As part of the homework submit a document, README.txt, from two to three double-spaced pages plus (may be) diagrams, describing your program. Your description is addressed to a technical manager whom you want to understand what you have done, the alternatives that you had, why you made the choices you made, and how you tested your program.

Include also a second document, RUNS.txt, describing the data you have used to test your program and what you have learned from it. You should choose reasonable values for the interarrival times and for the CPU service times [for simplicity, choose a Q defaulted to 0.2, and use a service time at the disks equal to the service time of real disks]. If you can determine what is the smallest reasonable interarrival time [how should we define this "reasonable"?].

Place your homework in the Drop box for the course in Blackboard. The homework will be graded by the TA on a scale of 0 to 20. The RUNS.txt file will be evaluated separately by the instructor for an additional 0 to 5 points.