CS 4633 Simulation Techniques

Spring 2005
Instructor Dr. Turgay Korkmaz

Homework 2 – programming (60 points)
Due by Feb 17, 2005 (3:30pm)

 

In this homework, you will implement a simulation program for the router example we studied in class (click here for that question). You will use C programming language and the event-scheduling approach (so, you will implement everything including event lists, random number generator etc.). Basically, You will use the event-graph that I gave in class and write a C program in the following form:

 

….

While (FEL is not empty) {

    Get the first event from FEL (ev_type, ev_time,…)

    t=ev_time;

 

 

    operations specific to ev_type…

}

 

 

For report (please type it)

Run your simulation program with different seeds (at least 3 times) for each value of P. Initially all queues are empty, terminate when 1000th customer departs.

For example,

Ø     Ø      sim –P 10 –seed 145

Ø     Ø      sim –P 10 –seed 223

Ø     Ø      sim –P 10 –seed 383

 

Ø     Ø      sim –P 20 –seed 445

Ø     Ø      sim –P 20 –seed 523

Ø     Ø      sim –P 20 –seed 683

 

 

Ø     Ø      sim –P 30 –seed 745

Ø     Ø      sim –P 30 –seed 823

Ø     Ø      sim –P 30 –seed 983

 

Based on the obtained results from your simulations, Fill the following table

 

 

Loss rate H

Loss rate L

P=10

Run1

Run2

Run3

 

-

-

-

 

-

-

-

P=20

Run1

Run2

Run3

 

-

-

-

 

-

-

-

P=30

Run1

Run2

Run3

 

-

-

-

 

-

-

-

 

 

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

 

  1. Hard copy of your program with comments (please after submission, don’t change your soft copy, if needed we will run your original program together).

 

  1. Analyze the different runs in the table and comment on how and why the same performance measure (e.g., loss rate H or L) changes from one run the other.