question

Leo L6 avatar image
0 Likes"
Leo L6 asked Felix Möhlmann commented

Conditional decide on resource available

How do I create a conditional decide based on whether a resource can be allocated? So I know you can use this: getstat(getactivity(processFlow, "Resource"), "ResourceAvailable", STAT_CURRENT, current) to get current number of resources available but I want to take it one step further and say "check if resource available WHERE Type ==1" for example.

How can I do this?

Thanks in advance

FlexSim 22.0.16
resourceconditional decidewhere query
5 |100000

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

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

The easiest I can think of right now would be to just try to acquire that resource with a maximum wait time and send the token to a different connector when the wait time elapses.

If you don't actually want to acquire the resource at that point you can release it immediately after.

Alternatively you could query the internal table (if the resource represents actual objects in the model and is not just Numeric). Or you go with a list instead of a resource to begin with. Which would allow you to use the first method of just trying to pull a value but leave it on the list, even if successful.

1683267354675.png


1683267354675.png (7.9 KiB)
· 5
5 |100000

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

Leo L6 avatar image Leo L6 commented ·
Thanks for the answer.

Yes I think what I'd be looking for is querying the internal table because the resource in this case does represent actual objects. How do I go about doing this?

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ Leo L6 commented ·

Hello @Leo L6, I created a sample model for you. The processor are placed into a group and that group is referenced in the list. The list is then referenced in the resource. Note: it is not the group referenced in the resource. You are then able to both query and acquire from the resource.

QueryResource.fsm

0 Likes 0 ·
queryresource.fsm (54.9 KiB)
Leo L6 avatar image Leo L6 Jeanette F ♦♦ commented ·
Hi thanks for help! I think this does look like it would work but would there be a way to do this without using a list at all? In Felix's earlier answer it sounded like we can query a resource if the resource represents objects in the model without using a list.
0 Likes 0 ·
Show more comments