question

Bryan Suharik avatar image
0 Likes"
Bryan Suharik asked Sam Stubbs commented

When Itemtype exits, it repleneshes with the same item type?

Hello, i'm searching for a simple solution via scipt to replenish a queue when an itemtype exits. It needs to replenish with the same itemtype that left the Queue.

Queue 1 has a "do not release" send to port as i don't want it to release until an item type leaves queue 2. But there are 5 different item types, so i don't want the pull to just pull the next in line item type from queue 1.

I've tried with the exit triggers to activate the pull requirement. But i can't figure out how the pull requirement can determine what itemtype just left Queue2 and call that one. Perhaps the sendmessage to Queue 1 from Queue 2 would be a good strategy, but i don't know how that would look via code.

QUEUE 1 ---> QUEUE 2 (leaving queue)

My entire model is built from GUI script on opening, so code solution is most desired.

Thanks in advance!!

FlexSim 16.2.2
codeoperatorspull strategy
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

Sam Stubbs avatar image
1 Like"
Sam Stubbs answered Sam Stubbs commented

One option, rather than use a script, is to use Process Flow. Have all of your items be pushed to a list, instead of flowing straight into the queue. Then have an event triggered source in your Process Flow, each time the trigger happens you can pull from the list and use a query to match the item type to the one that left.

Here's a quick example I created:

replenishitemtype.fsm


· 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.

Bryan Suharik avatar image Bryan Suharik commented ·
@Sam Stubbs

Hi Sam, thanks for all the help with this model. I've worked on it last couple days since your last recommendation and haven't made much progress. I attached the model.

What i need is for each Queue (wellsite 1,2,3,4,etc) to have that same process flow thats on wellsite 1. But i can't manually assign it to each one because the amount of wellsites is user defined by the GUI at the model setup. So i need a way to build a process flow like you've done in the attached, but then assign it to all of the wellsites upon creation if that makes sense.

THanks!

Bryan

0 Likes 0 ·
Sam Stubbs avatar image Sam Stubbs ♦ Bryan Suharik commented ·

Could you not have the process Flow be a Fixed Resource process Flow instead of a General one? Then just attach the desired objects (in this case the Well Site queues). In the Event Triggered source you can then just write "current" for the triggering object. Then it should run this process flow for each Well.

Alternatively, you could add the Well Site to a group, and then just reference the Group in the triggered object too.

0 Likes 0 ·
Bryan Suharik avatar image Bryan Suharik Sam Stubbs ♦ commented ·

@Sam Stubbs

That sounds like a good option. I'll see if i can get that to work.

Thanks!

0 Likes 0 ·
Bryan Suharik avatar image Bryan Suharik commented ·

@Sam Stubbs

Hi Sam, Can't seem to get it. Does the fixedresource process flow behave differently than a general process flow. I get quite a few errors when i run it. I have a feeling i'm close and it just needs a simple modification if you can help. Thanks! I attached a basic example just to get it work, then i can try to convert it to the more complicated model.

test.fsm

0 Likes 0 ·
test.fsm (28.0 KiB)
Sam Stubbs avatar image Sam Stubbs ♦ Bryan Suharik commented ·

Yes they are different in some ways. First of all you need to attach objects to a FR Process Flow. This process flow will then create an instance of itself for each attached object.

I've reattached your previous model with this change so you can see the difference. IN the event triggered source I just reference which Well Site with 'current' since I've attached each Well Site Queue to the Process Flow.

bryansuharik.fsm

0 Likes 0 ·
bryansuharik.fsm (106.5 KiB)
Bryan Suharik avatar image Bryan Suharik Sam Stubbs ♦ commented ·

@Sam Stubbs

but is there a way to attach the queues on trigger or set up of model automatically. The user builds the amount of wellsites on set-up, and it can't be a manual task to go in and attach the queues to that fixed process flow.

0 Likes 0 ·
Show more comments