Imagine we have a system consisting of a fixed number of servers simultaneously processing requests. The time for processing a request is constant. The number n of clients is assumed to be large, and the clients fire in a uniformly distributed way, independent of each other. Now let n go to infinity, i.e. assume that there are infinitely many clients. This is the situation simulated by this applet : The time between the requests arriving at the server system is then exponentially distributed with an expected rate r (the probability density of a time t is re-rt). When a request cannot be served because all servers are busy, the respective client does not wait (thus we are not considering a queueing problem), but repeats its request after a specified constant time. (Without this request repetition, the problem could be treated with standard probability theory and would not be worth a simulation.)
We are interested in the relative number of requests that are denied on the 1st or the 2nd call, respectively.
The input fields are pretty self-explaining. The expected rate is measured in Hertz (number of requests per second), the processing time and the "renew request" time in milliseconds. The time is scaled with the factor "time scale". If the time scale is 1, the process is simulated in real time. If the time scale is > 1, the process is simulated in slow motion, which may yield more correct results if the workload is heavy.
An interesting output field is "mean interval", which displays the mean value of the time intervals between the requests. Asymptotically this should be the reciprocal of the rate. I introduced this field for checking my random generator (cf below).
Implementation: the server is multi-threaded and uses a thread pool. The object representing the client population is essentially single-threaded (if it had a thread for each of a large number of clients, your computer would probably go nuts and deliver incorrect results) and uses a random generator producing approximately exponentially distributed positive random float numbers. This random generator was actually the hardest nut to crack for this applet. After one weekend of thought, I found a rather primitive implementation that was the only idea that did not lead to unsolvable mathematical or computational problems.
Requirements: You need to have installed a Java 2 runtime environment (e.g. JRE 1.3) or the Swing class library (just copy the file swing.jar contained in the Swing distribution available at Sun Microsystems to where your browser searches for Java libraries). The applet uses the Java Foundation Classes (Swing library) and works with
I haven't been able yet to get it to work with