How can I observe an entity passing from one block to another?

조회 수: 1 (최근 30일)
Arshya Feizi
Arshya Feizi 2021년 7월 5일
편집: Altaïr 2025년 4월 15일
I have a server block, a router, and another servers each on one of the two routes as seen below. I am trying to generate a signal like a pulse, message, etc. everytime an entity passes from the top path, but not the bottom.
I tried using the "Entity Replicator" on the top path and writing some functions on the replicated entities, but it messed up with the timings I need in other functions I have in S1 and S2. In other words, my outputs are different when I use the entity replicator on the path than when I don't. Does anyone have any ideas on how to do this?

답변 (1개)

Altaïr
Altaïr 2025년 4월 15일
편집: Altaïr 2025년 4월 15일
To generate a pulse signal each time an entity passes through the top path, an Entity Server combined with a Difference block can be utilized. Here's how it can be set up:
In the model, I have introduced a temporary Entity Server named "Dummy Server." Set its Service time to 0 and its Capacity to a very high value.
In the Statistics tab, ensure the "Number of entities departed, d" checkbox is selected. The output signal 'd' will be a step-type signal that increases by one unit each time an entity leaves the "Dummy Server."
To obtain a pulse-type signal, pass this signal through a Difference block, as depicted in the setup.
You can read more about the two blocks using the following commands:
Entity Server
web(fullfile(docroot, 'simevents/ref/entityserver.html#d123e23441'))
Difference
web(fullfile(docroot, 'simulink/slref/difference.html'))

카테고리

Help CenterFile Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by