SimEvents, multiple entity generation

10 views (last 30 days)
IIT Delhi Goel
IIT Delhi Goel on 28 May 2012
Commented: VBBV on 20 Dec 2020
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 Comment
VBBV
VBBV on 20 Dec 2020
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.

Sign in to comment.

Answers (1)

Devdatt Lad
Devdatt Lad on 28 Jun 2012
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.

Community Treasure Hunt

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

Start Hunting!