question

Jon Abbott avatar image
1 Like"
Jon Abbott asked Daniel Saravia commented

How to determine the index of a Process Flow resource being acquired?

I have a simulation model with a Process Flow resource called Operators set to numeric mode with a count of 3. Is there a way to get and set a label for the index that represents which number out of the three operators that a token has acquired? Here is an example of what I am trying to achieve:

  • At the beginning of the model, the operator resource has a count of 3 that are all available.

  • Token 1 would acquire the first operator out of the three, so it would set a resource index label value of 1 to represent this.
  • Token 2 would acquire the second operator out of the three available, so it would set a resource index label value of 2.
  • Token 3 would acquire the last available operator, and would set a resource index label value of 3.
  • Token 4 arrives while all operators are acquired, so it would wait to get the next available operator. For example, token 2 releases the operator soonest, so that freed up the second resource and then token 4 would have a resource index label of 2.
  • Token 3 finishes and releases the operator resource.
  • Token 5 arrives, acquires an operator resource, and would set a resource index label of 3.

The FlexSim documentation says, "If the Resource is in numeric mode, the label will be assigned the quantity acquired which will always be the same as the Quantity box." I'm looking not for the quantity acquired but for which of the three operators is being assigned when the resource acquisition happens.


Please let me know if you have any questions. Thanks in advance for your help.

FlexSim 20.0.3
process flowresourceresources
5 |100000

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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Matthew Gillespie commented

The numeric mode is very simplistic and won't do what you're looking for. However, you can set the resource's Reference to an array of values and acquire specific values that way. This is effectively just pushing those values to a list and then pulling something off when you acquire. Here's an example model.

arrayresource.fsm


arrayresource.fsm (27.4 KiB)
· 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.

Benjamin W2 avatar image
0 Likes"
Benjamin W2 answered Daniel Saravia commented

Hi @Jon Abbott,

One way to accomplish this is to change your resource to reference an Array of values, then create an array containing 1, 2, and 3. Then, when your tokens acquire the resource, they will acquire one of those numbers.

This should give you the behaviour you are looking for.


arrayofvaules.png (23.3 KiB)
· 3
5 |100000

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