Entity Output Switch changes results based on output label

Hello,
I have a SimEvents model with an Entity Output Switch with two outputs, called 1:"OUTPT" and 2:"OUTPI" that go to different parts of the model. I have the switching behaviour of the switch set to "First port that is not blocked" with the idea that entities will be released to the first path which can accept them independent of the number or order of the outputs. I found my model gives very different output if i change which output is attached to 1 and which is attached to 2 in the image below Shouldn't this switching criteria guarantee symmetry of outputs? What could account for this behaviour?

댓글 수: 1

Does the switch bias towards the last output used?
If 2 is blocked, the system will output to 1. If 2 becomes unblocked, that port still won't be chosen until 1 is blocked. This is what i see when my system creates a backlog at port 2 until port 1 is exhausted. Switching the port order biases the first entry when both ports are unblocked.
What i really want is control of the switch so that the output order is defined by earliest available sample downstream. My backup is to have each downstream queue send a message when it is available to build a "schedule array". The output switch would then direct entities according to the schedule.

댓글을 달려면 로그인하십시오.

답변 (1개)

Altaïr
Altaïr 2025년 1월 3일

0 개 추천

The First port that is not blocked switching criterion indeed causes the Entity Output Switch to select the last active port unless it's blocked. An alternative approach would be to use the Round robin or Equiprobable switching criteria.
Round robin is ideal when the throughput rates of the downstream lanes are similar, though it might lead to large waiting times if they aren't. Equiprobable is suitable if the entity generation rate and downstream throughput rates are time varying.
Additionally, here's an example for port selection based on the availability of downstream lanes.
The Custom Switch selects the available lane when only one is available, otherwise using Round robin to alternate between lanes.
The logic for choosing the corresponding output port is implemented using a Simulink Function block.
The corresponding Simulink model is attached for reference. For more details, please refer to the following documentation pages:
I believe this will assist you!

카테고리

도움말 센터File Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 2월 14일

답변:

2025년 1월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by