Topics in Performance Evaluation
Exercise 10 – Back to Event-Driven Simulation
We have used event-driven simulation in several exercises.
In this one we try to understand its behavior better.
Background
This exercise is actually based on the initial code you may have written in
Ex2a.
If you didn't, now is the time to make it up.
The basic engine is the same, but the simulated system is a bit more involved.
Assignment
- If you somehow do not yet have a basic event driven simulator, write one now.
- Build the following simulation that uses it.
This is similar to a simple M/M/1 simulation, but the details are different.
All the constants mentioned here should be parameters, as you will need to make
several runs and change them.
- Consider a simulated time span of 10 hours.
- During this time, 100 users arrive randomly (that is, at times
that are uniformly distributed over the 10 hours) and submit a request.
These arrivals are the initial events in the queue.
- When a user arrives, serving him takes a time that is uniformly
distributed from 1 to 3 minutes (with a resolution of at least seconds, i.e. not
only 1, 2, or 3 whole minutes).
Simulate this by creating a termination event with the appropriate timestamp.
- After service ends, the user either departs or continues his session
and issues another request.
The probability to continue is p.
The new request then arrives after a time that is uniformly distributed from
2 to 10 minutes (again, at least at second resolution).
Simulate this by creating a new arrival event with the appropriate timestamp.
- The session continues in this manner until the user departs.
- The system can serve one user at a time; if there are any more
requests they wait in the queue.
- Run several simulations, where the difference is the
probability p (and hence the expected number of requests that each user makes).
Specifically, use p = 0.1, 0.2, 0.3, ... 0.9.
What is the resulting average session length as a function of p?
What is the utilization of the server as a function of p?
Did you get what you expected?
- Run the whole set again with a longer simulation – a total
of 100 hours, and 1000 users (i.e. 10 times longer).
Collect the same results and compare.
- Your main task, apart from writing the simulation, is to
understand what is going on.
Is everything OK?
Does a longer simulation provide more accurate results?
Submit
Use
Moodle to submit
a report on your work, in pdf format, with the following data.
- Your names, logins, and IDs
- All the outputs in an orderly manner, i.e. tables and/or graphs.
Include the average session length and utilization as a function
of p for both the short and long simulations.
If there are any other metrics that are interesting to follow
include them too.
- Comment on the results.
Do you have anything to say? Are you happy with them?
- Speculate on what would happen if the simulation was completely
"open system", and all the arrivals in each session were created
in advance rather then being created piecemeal during the simulation.
- An appendix with the simulation code for all cases.
Submission deadline is Monday, 9 June 2014,
so I can give feedback in class on Tuesday.
To the course home page