question

Mohamed Eldakroury avatar image
0 Likes"
Mohamed Eldakroury asked Mohamed Eldakroury commented

Acquire resources from multiple resource lists

Hello,


I am trying to build a custom BFR and reuse it for my future models. I want it to be as general as I can, so that when I copy the process flow, or the BFR in other models I just change one or two references then it works.

The concept I am trying to build is as the following:

My BFR is a multiprocessor that allows multiple operators to work on different tasks at the same time. When a flow item shows up, all the operators connected to the dispatcher that belongs to this BFR will be called but they will start working on different tasks until all tasks are completed.

The reason I have two BFRs here is that I wanted to test how the logic will work with multiple BFRs, but my ultimate goal is to create one BFR with its own logic and save it.


I have a few questions about the model that I posted here, but let me start with one here for now.

1. Can different tokens acquire a resource from different resource lists (not at the same time)? The logic for BFR1 and BFR2 is exactly the same, however, If a token was created by BFR1, I want it to acquire resources from the BFR1 list. If the token was created by BF2, I want it to acquire resources from the BFR2 list. So, I want my "Resource Reference" to be a variable. I've been looking at token.item.current but it looks like this is not the right answer. I can maybe create a label on the token that stores information about the current object, then use it as a reference, but is there something already built in that I can use? The quantity will always be 1, so no need to make it a variable.

1709130078089.png



AcquireResourcesFromMultipleLists.fsm

FlexSim 23.2.0
processs flowacquire resource
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Paula LG avatar image
0 Likes"
Paula LG answered Mohamed Eldakroury commented

Hi Mohamed,

For that, you need to select the "Resource Named" option (by clicking on the arrow next to the Resource Reference field and write current.name on the window that pops up.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Mohamed Eldakroury avatar image Mohamed Eldakroury commented ·
Thank you!
0 Likes 0 ·
Mohamed Eldakroury avatar image
0 Likes"
Mohamed Eldakroury answered Mohamed Eldakroury commented

Thank you, that worked!

The other related question to that, is, if I want to avoid renaming the lists for every BFR I have in the model, I thought maybe a better way is to use centerobject(current,1) as a list reference for each list. To my understanding, if I set it this way, if a flowitem arrives at BFR1 it will try to pull resources from the operators connected to the dispatcher connected to BFR1 via center port, and will do the same thing when it arrives at BFR2. Do you think this is right?

That seems to work how I want it, but I can't have the "Count" as a fixed number. I need to have the "Count" refer to the number of operators connected to the dispatcher.


1709134083565.png


AcquireResourcesFromMultipleListsV2.fsm



· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Paula LG avatar image Paula LG commented ·

Yes, that's exactly how it works!

For the count field, you can use reference.outObjects.length

0 Likes 0 ·
Mohamed Eldakroury avatar image Mohamed Eldakroury Paula LG commented ·
Great, that worked too!
0 Likes 0 ·