question

Piotr K3 avatar image
0 Likes"
Piotr K3 asked Jeff Nordgren answered

pull strategy - order of items

Hi,

I want to build a simple model with 2 item types and 1 processor. What to do in the processor input to set the order of proceded items (for example 3 items with itemtype=1 then 2 items with itemtype=2 and again)? I'm thinking about global table or global list but I'm not quite sure what to set in them.

FlexSim 18.0.3
pull 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.

Kari Payton avatar image
1 Like"
Kari Payton answered Kari Payton edited

You can add a custom code to the processor's "OnEntry" trigger. To use this code below, create a label on the processor called "count". The main idea is that the count will keep track with the # order of processed item. Then based on the number, it will assign the items "Type" 1 or 2 and change the count label.

if (current.count == 1) 
{
item.Type = 1;
current.count = 2;
} 


else if (current.count == 2)
{
item.Type = 2;
current.count = 3;
}


else if (current.count == 3) 
{
item.Type = 2;
current.count = 1;
}

Or you can do as you said and on the source create an arrival schedule with label Type for all of the arrivals. arrivallabels.fsm


arrivallabels.fsm (133.7 KiB)
· 1
5 |100000

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

Kari Payton avatar image Kari Payton commented ·

@Piotr K3 did this work for you?

0 Likes 0 ·
Jeff Nordgren avatar image
0 Likes"
Jeff Nordgren answered

@Piotr K3

The way I understand what you are saying is that you already have a source that is producing flowitems with itemtypes 1 & 2. And what you want to do is to pull those itemtypes based on what you described, 3 of type1 then 2 of type2 and then repeat. And not create those flowitemtypes at the Processor.

Attached is a sample model that will do what I believe you are describing. Itemtypes 1 & 2 are created in the Source. Then in the Pull Requirement of the Processor is where I put all the code to do what you are describing. Take a look at the model and see if a solution like this would work for you.

Thanks.

pullsample-jn1.fsm


pullsample-jn1.fsm (18.0 KiB)
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.