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

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!

 Risposta accettata

Epsilon
Epsilon il 13 Gen 2025
Modificato: Epsilon il 13 Gen 2025
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 Commenti

john
john il 13 Gen 2025
Modificato: john il 13 Gen 2025
First of all, I cannot tank you enough for your answer, I was searching for days how to achieve this outcome. If you can, please help me with this too. I want a certain delay on the resource arriving the resource pool. I tried using a transport delay block but while the entities generated are 11 the resourses available are 12 which makes no sense at all. In the transport delay block I used time delay 1. I also don't understand why the resource pool scope stops at 10 secs when it should stop at 11 since you have 1 sec delay so 10 secs of simulation would end at 11. If instead of a transport delay block an entity server block could be used it would be even better so I could use a queue for the incoming resources. All of the above are based on the attached model you provided me. Again I am grateful for the help!
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.
ok thanks again have a good day

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Resource Allocation Modeling in Centro assistenza e File Exchange

Prodotti

Release

R2024b

Richiesto:

il 12 Gen 2025

Commentato:

il 14 Gen 2025

Community Treasure Hunt

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

Start Hunting!

Translated by