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 Center および File ExchangeEvent Functions についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by