Hello guys!(adsbygoogle = window.adsbygoogle || []).push({});

I am learning a bit on queue theory in one of my courses, and decided to try and do some simulations even though it is not mandatory. (Curriculum only covers the steady state, where it can be treated mathematically with ease).

Im looking at a birth-death process, where the time til next birth and next death are both exponentially distributed.

My algorithm:

---------------------------------------------------------------------------------------------------------------------------------------------

Intitialization: Set state to [itex]n=0[/itex](Number of people in queue and getting service) , set current time [itex]t=0[/itex], choose end simulation time [itex]t_{max}[/itex]

Loop until the time [itex]t[/itex] has reached [itex]t_{max}[/itex]:

- Get two random numbers from exponential distributions. One representing time until next death. One until next birth. The two numbers have different rate parameters.

- Choose the lowest of these two numbers as [itex]\Delta t[/itex].

- Set the state to [itex]n+1[/itex] or [itex]n-1[/itex], depending on which of the numbers were chosen.

- Update the time [itex]t \rightarrow t +\Delta t[/itex].

- Save the state and time period.

End loop.

----------------------------------------------------------------------------------------------------------------------------------------------

This process is repeated many times, and used to create probability densities for each of the states.

My question:

My algorithm simply discards the higher of the two randomly generated numbers. The state is then updated and two new random numbers are generated. Is this correct, or should the value of the second number be taken into account somehow after changing to the next state? The rate parameters of the probability distributions are not generally the same at each state.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Stochastic queue simulation

Loading...

Similar Threads - Stochastic queue simulation | Date |
---|---|

I A seemingly simple problem about probability | Jan 29, 2018 |

About the strategy of reducing the total suffering in a queue | Dec 28, 2017 |

I Probability of a Stochastic Markov process | Dec 27, 2017 |

A Help with this problem of stationary distributions | Nov 7, 2017 |

I Autocorellation of a stochastic process | Oct 7, 2017 |

**Physics Forums - The Fusion of Science and Community**