question

G C avatar image
0 Likes"
G C asked tannerp commented

Dont pull operator unless Resource available

In process flow, if I have two acquire resources (machine and operator), how do I enforce pulling only if both resources are available?

Right now, I'm using a max wait timer on the 2nd acquire resource set at 0.001 minutes with a decide on "failed" label and loop to release and reacquire the first resource again. Basically I'm releasing the first first resource and retrying to acquire both resourced within 0.001 mins.

This seemed inelegant to me, looking for other solutions.

FlexSim 18.2.2
process flowresource release
· 7
5 |100000

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

G C avatar image G C commented ·

I think I just need the code to pull and release process flow resources if anyone can provide. Then I can just make the custom code to do what I need.

0 Likes 0 ·
tannerp avatar image tannerp commented ·

A token in Process Flow won't continue from one "Acquire Resource" activity to the next until it has successfully pulled the desired resource. The only exception would be if you used a "Max Wait Timer" option, in which case the token would continue without having pulled the resource.

I'm assuming that you don't want the token to pull a machine, for example, and then wait for an operator while the machine could be utilized elsewhere. Is that correct?

You might consider using Lists instead of Resources. This way you could use custom code to do listpull and listpush commands. I'm just not sure all the implications of either for your model.

0 Likes 0 ·
G C avatar image G C tannerp commented ·

Could you provide an example of the custom code?

0 Likes 0 ·
tannerp avatar image tannerp G C commented ·

There's a lot of capabilities with this. I would reference the user manual for a description of all the parameters. Here's an example of how you would pull something with custom code:

List("ItemList").pull("WHERE type = 3 ORDER BY age", 3, 2, current, current.station)

To access this in the user manual, look under Help -> Commands -> Deprecated then search for "list" and you'll find the code. Note that there is updated syntax in newer FlexSim editions.

0 Likes 0 ·
Show more comments
Jeff Nordgren avatar image Jeff Nordgren commented ·
@G C

Could you possibly send us your model or a sample model of the problem? That would aid us greatly in being able to give you the best answer.

Thanks.

0 Likes 0 ·
G C avatar image G C Jeff Nordgren commented ·

example.fsm

Here is a simple example. Flow 2 is delayed waiting for 'Resource 1' which has been acquired by Flow 1.

I assume I need some sort of loop which checks both 'Resource 1' AND 'Resource 2' are available.

0 Likes 0 ·
example.fsm (21.2 KiB)

1 Answer

·
Raja Sekaran avatar image
2 Likes"
Raja Sekaran answered Raja Sekaran edited

@G C

I have used wait for event activity that listens to the OnResourceAvailable event. This helps to check the available resource to acquire. I have attached the updated model.

Hope this helps.

Thanks

Updated: acquireresource-support.fsm


5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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