Is it possible to divide a resource from a resource pool into different percentages?

33 ビュー (過去 30 日間)
Prashant Kashyap
Prashant Kashyap 2024 年 11 月 25 日 8:43
コメント済み: Prashant Kashyap 2024 年 11 月 26 日 10:39
Suppose there is a resource pool "trucks" which transports different materials to another location. While transporting, I want to fill a truck with 20% a, 30% b and 50 % c. The truck will transport the materials, get empty and then become available again.

回答 (1 件)

Pramil
Pramil 2024 年 11 月 26 日 5:33
編集済み: Pramil 2024 年 11 月 26 日 5:35
Hello Prashant,
Since your resource is the "trucks", you can define an "Entity Generator" block that mimics the loading behaviour for the "truck".
Here is how you can achieve this:
  • Add an "Resource Pool" block namely "truck" along with an "Entity Generator" block and open it's dialog box.
  • Set the "Generation method" to "Time-based" and set a "Period", time required to load the "truck".
  • Navigate to "Entity type" and create attributes for each material "a","b" and "c" with initial value set to "0". Add an additional attribute say "plate" to identify different "trucks".
  • Navigate to "Event actions", under "Generation action" and add the following code:
persistent number_plate
if isempty(number_plate)
number_plate = 1;
end
entity.Plate = number_plate;
entity.a = 20; % modify the quatity as per requirement ...
entity.b = 30; % as well as you can add any logic or create an array for different timestep ...
entity.c = 50; % where index could be number_plate having different composition of materials.
number_plate = number_plate + 1;
  • Add other blocks like "Resource Acquirer", "Entity Server" etc as per your modelling requirements.
  • At last unload the "truck" using an "Entity Terminator" block.
I have attached an example model that I have created for your reference.

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by