How can I use the resource amount source on the resource pool block?

조회 수: 3 (최근 30일)
john
john 2025년 1월 12일
댓글: john 2025년 1월 14일
I want to model in simulink. I am using a resource pool in my model and each time an entity is generated I want the resource pool amount to increase by 1. I tried to use the option Resource amount source : Change amount through control port but I cannot figure out how to do it. Any help would be appreciated!

채택된 답변

Epsilon
Epsilon 2025년 1월 13일
편집: Epsilon 2025년 1월 13일
Hi John,
Changing the 'Resource amount source:' option to 'Change amount through control ports' is indeed the correct first step towards achieving the above-mentioned goal. On doing so an input port appears. Pass a message using 'Message Send' block to this port, as the 'Resource Pool' block does not accept signals form Constant blocks directly as an input.
To trigger the message only when a new entity is departed, please follow the below mentioned steps:
  1. Enable 'Number of entities departed, d' option in the 'Statistics' tab of the 'Entity Generator block Parameters'. This enables an output signal.
  2. Connect the output signal from 'Entity Generator' block to a 'Detect Change' block input port.
  3. The output signal of the 'Detect Change' block can then be passed on as an input to the 'Message Send' block.
The above steps have been implemented in the attached model and can be used for reference.
Please find links to Documentation on the above-mentioned blocks for further reference:
Hope it helps.
  댓글 수: 3
Epsilon
Epsilon 2025년 1월 14일
To add a delay in the addition of resource in the resource pool consider adding a 'Delay' or 'Delay One Step' block before the 'Detect Change' block. One step delay would mean one minor step delay therefore to match the delay by 1 sec, change the delay length to 5 in the properties section. As the Entity Generator works at discreete time steps, 'Transport Delay' block is not the right fit in this case.
Also the delay blocks delay the signal value by a defined timestep and do not change the defined simulation time, therefore the simulation will still end at 10. To increase the simulation time change the 'Stop Time' value in the Simulation tab on top part of the screen.
john
john 2025년 1월 14일
ok thanks again have a good day

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by