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

1 次查看(过去 30 天)
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