How can an entity in a process simulation that stays in the system after the simulation time is over move on?

6 次查看(过去 30 天)
Hello, recently I have encountered such a problem in the learning of process simulation, when I set the simulation time, at the end of the simulation there will exist some entities still in the system without the completion of the service, I need this part of the unfinished service of the entity to move on, how to do it? I have searched to use the trigger subsystem to complete this function, but did not find the relevant examples can refer to, I hope someone can answer my question, thank you!

回答(1 个)

Ashok
Ashok 2024-11-21
Hey @inori,
From what I understand, a SimEvents simulation is being run, and some entities haven't reached the terminal state by the end of the simulation.
A straightforward way to handle dynamic termination is to set the simulation's Stop Time to 'inf' (or a very high value) and use the Stop Simulation block to end the simulation when needed.
The attached file example_R2021b.slx includes the following model.
In this setup, the Gen_5s block generates entities for the first 5 seconds at a rate of 10 entities per second. The Entity Server has a capacity limit of 6, so some entities don't reach the terminal state if Stop Time is set to 10 seconds.
Instead, the Stop Time is set as ‘inf’ and a condition is used to monitor when the number of entities in the server reaches 0, using the Compare to Zero block. The resulting boolean signal triggers the Stop Simulation block, which then terminates the simulation.
For more details on the Stop Simulation block, check out this documentation page: 
I believe this will assist you!

类别

Help CenterFile Exchange 中查找有关 Discrete-Event Simulation 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by