question

Bryan Suharik avatar image
0 Likes"
Bryan Suharik asked Matthew Gillespie commented

Double Partition Process flow

bryansuharik1.fsmHello, i'm trying to figure out how to assign a double partition. Attached is my model. This model is dynamic in the sense that the user uses the GUI (GUI1) to define the amount of wellsites (queues) in the process. Right now i have all flowitems initially enter the wellsite queues and are pushed to a list with a partition by item type(there are 5 item types per queue).

Each item type as different release rate from the queue it resides in defined by global table (arrivals). Currently, all of the flow items for all the queues are loaded into the item list, however, i need an additional partition that isolates the grouped itemtypes by wellsite. I don't think its possible to build multiple process flows with multiple lists separately since the user defines how many wellsites there will be. I'm thinking a method would be to partition by wellsite and then query the itemtype, but not sure how to set that up.

Any help would be most appreciated. May help to run the model briefly to see how it is releasing the flowitems. For example, i need itemtype 1 to release from each wellsite every X amount of hours. Currently, itemtype 1 releases every X amount of hours, but not from every wellsite individually.

Thanks!!!!

FlexSim 16.2.2
processflowpartition
bryansuharik1.fsm (72.9 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.

Sam Stubbs avatar image Sam Stubbs ♦ commented ·

I don't think you can add a second subset of partitions to a list. It sounds like you might need to create a second list. One list to handle the setup of your model, and another list to handle the working logic of your model. Do you think that would work with your situation?

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

@Sam Stubbs

I'm not sure if that would work. I need each individual wellsite releasing flow items according to Process flow 1. Right now i'm trying to write the script to essentially copy the processflow node for as many wellsites that exist. So for 8 well sites, would have 8 process flows with 8 global lists.

0 Likes 0 ·

1 Answer

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

Like you mentioned, you need to partition by wellsite and then query the itemtype. You are currently partitioning by itemtype. Change all the partition fields to refer to the wellsite and then add a query to your Pull from List activities that looks like this:

WHERE itemType = Puller.itemtype

You'll also want to add an itemType expression field to your list. (On the field tab click the green add button, item -> itemType).

· 8
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 ·
4918-bryansuharik2.fsm @Matthew Gillespie

Hi Matt, thanks for the answer. That's exactly what i'm trying to do, but now i can't get the flowitems to release at the scheduled intervals. Basically, I need flow item 1 to release from a wellsite every 162 hours and every 22 hours as well. The 162 hours is labeled as a PM, while the 22 Hours is labeled as a Repair/Failure.

This model is built from GUI 1, so the wellsite tokens have to be on entering the wellsite queue and be able to be isolated to each wellsite. I've attached the changes i've made per your suggestions, but still missing something if you're able to help.

Thanks!

Bryan

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Bryan Suharik commented ·

I'm having a hard time following the logic in your model. It looks like you misspelled wellsite in one place and you didn't add an itemType field to the list. Rather than struggle anymore with your model I made some sample models that demonstrate a few ways to do this that you can explore.

Partition by WellSite, Query Itemtype

This model shows how to use one global list that is partitioned by wellsite. Items are pushed to the list in the Send To Port field and they use current as the partition ID. The other queues are pulling from the global list and each one wants a specific itemtype from a specific wellsite. When they pull from the list they pull from the partition corresponding to the wellsite they want and then use the query field to specify which itemtype they want. Note the global list has an ItemType field configured.

Partition by WellSite, Query Itemtype - Instanced Process Flow

In this model I introduce using an instanced Process Flow. I added a Fixed Resource Process Flow to the model and built my logic in there. Then I attached this process flow to the wellsites. Instanced Process Flows like this are great when you want multiple objects in your model to use the same process flow logic. The wellsites are still pushing items to the global list, but now in the process flow I am pulling from the list using current as the partition, and then querying the itemtype.

Instanced Process Flows - Local Lists

This model shows, in my opinion, the best way of doing this. Instanced Process Flows also allow you to make Shared Assets (like Lists) local. This way instead of one global list that is partitioned by wellsite, I let each wellsite use its own local list. And since I'm using instanced process flows, I only have to define the list once and each instance will make its own list. So now each wellsite has its own local list, and so on entry it pushes items to its own list and uses the itemtype as the partition. The tokens delaying then pull from the local list also using the itemtype. I no longer have to use any queries.

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

@Matthew Gillespie

Hi Matt, I like option 2 as it seems to fit my application best. I've tried to build the same process flow and have copied the trigger code over, but its not quite functioning. If i copy the node directly over from your sample, it works great but gets some sort of binding issue. I think its due to being built in an older model.

Lastly, with option 2, is it possible to add a label to the flowitem that is released, and if so, where would it be located at. I assume in the releasetoken script, but not sure where. I need the PM one to have a PM label, and the repair one to have a Repair label.

Thanks for all the help. This is the last main piece of this puzzle. appreciate all the advice, i've learned quite a bit about process flows on this.

thanks,

Bryan 4918-bryansuharik1-1.fsm

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Bryan Suharik commented ·

On your scheduled source activity the Quantity cells have the code in them as strings, not code. I would click on a Quantity cell in the table, then in the Edit field under the table click the sampler button and sample the Arrivals table and reselect the gettablerows("Arrivals") option.

Yes, just add an Assign Labels activity between the Pull from List and Custom Code activities.

0 Likes 0 ·
Bryan Suharik avatar image Bryan Suharik Matthew Gillespie ♦♦ commented ·

@Matthew Gillespie

Excellent, that did the trick.

for the labels though, how do i differentiate between PM vs Repair. Won't the assign label just assign it to every token. I need Repair tokens to have the "Repair"label on the flowitem and "PM" on the PM flowitems.

thanks!

0 Likes 0 ·
Show more comments
Bryan Suharik avatar image Bryan Suharik commented ·

@Matthew Gillespie

Thanks for all the help on this model Matt. Seems to be working exactly as intended.

Is there a way via script to attach a group to the processflow so that the wellsites are attached when i run the GUI?

Thanks again for all the help.

Bryan

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Bryan Suharik commented ·

I created a new question since this is a new topic and answered it there. There isn't a way to assign a group to the Process flow, but you can attach new objects to the Process Flow with code.

0 Likes 0 ·