University of Ottawa
SEG-2106 : Software construction
Gregor v. Bochmann
2011, 2012, 2015, 2016

SEG-2106 - Lab-11

Simulations and performance measurements

Note: This was Lab 10 earlier


In this lab, the student will

We consider a simulation program with a future event queue which simulates a server with a queue. You can find the Java program and an explanation.

Things to do:

  1. Get familiar with the Java program.
  2. Run the program for simulating different cases of system utilization rho (percentage of time that the server is busy = average interarrival rate * average service time).
  3. For a system utilisation of rho = 0.5, perform 5 simulations with different random seeds and record the values obtained for the average queue length and the average of the measured system utilisation (percentage of time that the server was found busy). Calculate the average and standard deviation of the measured values for queue length and system utilisation over the different 5 simulations. Use the well-known formula from statistics (see Wikipedia - "Standard error of mean" - see also Standard Deviation) to calculate the expected error of the measured average values for these two quantities.
  4. Do the same measurements and calculations as under point 3 for 5 different values of rho.
  5. For the average queue length, produce a graphic representation of the measured values (obtained under point 4) with their expected errors (as calculated under point (3)) on a x-y-diagram where the x-axis represents the value of rho (from zero to one) and the y-axis represents the value of the average queue length. It is suggested to use Excel to create such a diagram. The diagram should also contain the expected values based on the mathematical formulas for queuing systems. You should check whether the theoretical points lie within the expected errors of the measurement values. Suggestion: Use Excel and enter 4 series of numbers: The theoretical value, the measured average, the upper limit of expected error (average + expected error), and the lower limit of the expected error (average - expected error).
  6. Change the Java program to introduce two priorities, using a queue for each priority. We assume that the number of requests of high and low priorities are (on average) the same. Measure the response times separately for both priorities. Do the performance measurements for different values of rho (see point (4)) and explain the results obtained.
  7. IF ENOUGH TIME: Change the program of point (4) in order to obtain a system with three servers (each having a 3 times longer service time) which use a single queue. Do performance measurements for rho = 0.8 - and discuss the obained results by comparing with the results of point (4), and by considering the prediction of the theoretical formula.
  8. IF ENOUGH TIME: Change the program of point (7) in such a way that the three servers use three separate queues. Do the same performance measurements and compare the results with point (7).

Lab report to be submitted to TA (during the following lab session)

This report should explain what you did and what results you obtained in relation with the points (2) through (6) above, and possibly about points 7 and 8.

Last update: April 1, 2016