It's noted that the number of folks in a stationary system will maintain an average equal to the rate of arrival multiplied by the mean of the service distribution.
The formula $L = \lambda w$ is valid for any queueing model in steady-state, where $L$ and $w$ are long-term steady-state average values respectively, and $\lambda$ denotes the arrival rate to the system.
We can add up the total service time in the system as follows:
$$\sum w_{j} = \sum i T_i$$
where $T_i$ represents the time units in which $i$ entities were in the system.
But things are always more interesting with sample sizing and simulating results, so say in $5000$ iterations we estimate a state of a system in 1-min intervals, between the first minute and the last arrival at a determined time.
So suppose we use a random interarrival rate of $\lambda = 2$ per minute and the service distribution is $N(8,1)$ minutes for the system.
How can I simulate this model in R, using rexp()
and rnorm()
? I also want to display in ts()
to show in time plot.