MATLAB: Time and event based data into ressource pool

eventresourceSimEventssimulinktime

Hello everyone,
I have a model with both time and event based aspects. In a time based simulation, a recycling facility is modeled that continuosly takes in material and outputs amongst others) a recycled target material. In the event based part of the model, a manufacturing facility is simulated: Orders arrive and are processed, consuming the material provided by the recycling facility.
I get both parts to work fine, the only problem is: I want the Ressource Pool the manufacturing draws from to be fed by the recycling. To do that, I have to claim that the ressource is "Reusable upon release", so I set the "Resource amount source" to Signal port. Using a "Time to Event Signal" block, this works well, the Ressource pool will hold the material recycled in the recycling line. But as material for production is obviously not reusable, I tried to manually substract the used material: The entities that represent the manufactured products have a "size" attribute. I was trying to add those up using "Sum of Elements", and was playing around with other approaches, but none worked.
Any ideas on how to solve that? Thanks a lot!

Best Answer

For anyone who stumbled upon this, the answer is simple enough - use the #d port of the Resource acquire block, which tracks the number of finished products, time the material attribute, thus calculating the total matial used. Substract from the total recylced material.
Related Question