how i can generate multiple entities with same Generator Block (simevents)?

5 vues (au cours des 30 derniers jours)
matteo bartoloni
matteo bartoloni le 22 Nov 2018
Commenté : Robert Kugler le 16 Mai 2020
Hey, for example i want generate 2 enties every 1 second with same Generator Block ( in 10 second of simulation i want see 20 entities in Entity Terminator) . Can someone help me?

Réponses (1)

Krishna Akella
Krishna Akella le 4 Déc 2018
Hey Matteo,
You can setup the 'Entity Generator' block so that the 'Time source' is set to 'MATLAB action'. Then you can write the following:
persistent genTwice;
if isempty(genTwice)
genTwice = true;
end
if genTwice
dt = 1;
genTwice = false;
else
dt = 0;
genTwice = true;
end
The value returned by the MATLAB action is 'dt', which is the delta time for the arrival of the next entity or the entity inter-generation time. By flipping the value of dt to be either 1 or 0, you can achieve what you want.
If you have a more complex entity generation pattern, you can read in the values from an excel sheet or a MAT file into your workspace and assign them to dt.
You can see the shipping example seExampleEstimatingAssemblyLineThroughput, that reads from an excel sheet to generate parts as per a pre-defined schedule.
- Krishna
  2 commentaires
matteo bartoloni
matteo bartoloni le 5 Déc 2018
Thank you so much Krishna!!!!!!!!!
Robert Kugler
Robert Kugler le 16 Mai 2020
Hi Krishna,
What if I want to randomize the number of entites created within one time interval?
For example, if I assume a binominal experiment for the entity generation with 20 trials and probability 0.05. Every time interval the generator should generate a number of entities, based on this probability. How do i do it?

Connectez-vous pour commenter.

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by