How can limit the number of generated entities in SimEvents?

6 visualizaciones (últimos 30 días)
Zahra Moussavi
Zahra Moussavi el 3 de Mzo. de 2016
Comentada: Teresa Hubscher-Younger el 3 de Mzo. de 2016
Hi,
I am simulating a concrete pouring process with SimEvents. The entities are the truck mixers entering the construction site. The number of trucks is fixed and for instance equal to 20. I need the entity generation to stop generating entities once the 20th entity is generated. I wil appreciate any hints on this matter.
  1 comentario
Teresa Hubscher-Younger
Teresa Hubscher-Younger el 3 de Mzo. de 2016
Hi,
I believe this documentation will help you. Basically, you use a Function-Call Generator to create 20 events to generate the Entities and then stop. http://www.mathworks.com/help/simevents/ug/generating-multiple-entities-at-simulation-start.html
Please let me know if this doesn't help.
-Teresa

Iniciar sesión para comentar.

Respuestas (1)

Devdatt Lad
Devdatt Lad el 3 de Mzo. de 2016
You have a couple of options on how to create your expected number of entities.
If you know when the 20 entities are to be generated, then use an Event-Based Sequence block connected to a Time Based Entity Generator which generates entities based on the intergeneration time from port t. In the Event-Based Sequence block, you can specify the intergeneration time and end the vector output with inf to stop entity generation. For example, if you want to generate 20 entities every one second specify your output vector to [repmat(1,1,20) inf];.
If you don't know when trucks will be generated (not deterministic) then you can use an Enabled Gate to stop generated entities from entering your system by closing the gate once you have generated 20. A statistic output from the Entity Generator can give you the count of how many have departed so far.

Categorías

Más información sobre Discrete-Event Simulation en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by