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

10 Ansichten (letzte 30 Tage)
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?

Antworten (1)

Krishna Akella
Krishna Akella am 4 Dez. 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 Kommentare
Robert Kugler
Robert Kugler am 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?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Discrete-Event Simulation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by