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!
댓글 수: 0
답변 (1개)
Ashok
2024년 11월 21일
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!
댓글 수: 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!