SimEvents, multiple entity generation
2 ビュー (過去 30 日間)
古いコメントを表示
I'm using SimEvents for a Discrete event simulation. I want to integrate it with an excel document where i have a column with time and 2nd column corresponding to no. of entities produced at that time. But i cant figure out how will multiple entries be generated as in time based entity generator, one specifies a signal and only 1 entry is generated corresponding to the signal at every time step.
For example at 0 time I want to have 20 entities generated then at 1000 time i want to have 15 entitites and so on.
1 件のコメント
VBBV
2020 年 12 月 20 日
Are the entities stochastic or deterministic ? if its stochastic event generator at a given time, use rand function to specify the number of events, otherwise use linspace function to specify the number of events.
In any case, you require user input variables to store the number of events generated at a given time since at each time the number of events required are varying.
回答 (1 件)
Devdatt Lad
2012 年 6 月 28 日
The input signal to the Time Based Entity Generator block is "inter-generation time" and not absolute generation time. Hence if some values of your input signal are 0, i.e. inter-generation time is 0, then multiple entities will be created at the same time by the block. Each time an entity is generated, the value of the input will be read in to determine when the next entity is to be generated.
So if you want 20 entities at time 0 and then 15 at time 1000 then you can enter the following vector in your Event-Based Sequence block which is feeding your Time-Based Entity Generator:
[repmat(0,1,20), 1000, repmat(0,1,14)]
For the first 20 entities, inter-generation time is 0, i.e. simultaneously generated entities. The next inter-generation time is 1000. This will cause the 21st entity to be generated at time 1000. The remaining 14 entities are also needed at this time, so their inter-generation time is 0.
0 件のコメント
参考
カテゴリ
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!