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

1 view (last 30 days)
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?

Answers (1)

Altaïr
Altaïr on 15 Apr 2025
Edited: Altaïr on 15 Apr 2025
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'))

Categories

Find more on Discrete-Event Simulation in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!