Entity Queue not showing correct average waiting time and average queue length

11 vues (au cours des 30 derniers jours)
Amir Etemadi
Amir Etemadi le 12 Juin 2022
I am trying to simulate a very simple M/M/1 system.
When I use the following code in Entity Generation, average waiting time and average Queue length are shown as zero: dt=-3*log(1-rand());
However, when I use the following code, those "l" and "w" values are as expected:
persistent rngInit;
if isempty(rngInit)
seed = 12345;
rng(seed);
rngInit = true;
end
% Pattern: Exponential distribution
mu = 3;
dt = -mu * log(1 - rand());
Can someone please explain why?
I have also attached Bad and Good simulations based on version R2021a.

Réponses (1)

Hornett
Hornett le 27 Oct 2023
Hi Amir,
I understand that you are facing an issue while building a simple M/M/1 system. I have reviewed your code, specifically the "Bad_Q.slx" file, and noticed that you have not seeded the random number generator. As a result, the entity server is serving requests faster than the entity generation, leading to zero values for "I" and "W" in "Bad_Q.slx".
To ensure accuracy and obtain consistent output from the random number generator, I recommend seeding the random value generator.

Catégories

En savoir plus sur Discrete-Event Simulation dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by