how i can generate multiple entities with same Generator Block (simevents)?
6 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
Krishna Akella
2018 年 12 月 4 日
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 件のコメント
Robert Kugler
2020 年 5 月 16 日
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?
参考
カテゴリ
Help Center および File Exchange で Discrete-Event Simulation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!