question

Ane avatar image
0 Likes"
Ane asked Jeanette F commented

Pull from 2 different Criteria

In my Flexsim model, two labels are assigned numerical values for items in a queue: Percentage and Ref. Percentage is calculated based on a formula and produces a different value each time. Ref ranges from 1 to 6. I want to implement a pull system where two machines pull items from the queue. The first criterion for the machines is to select the item with the lowest Percentage value. Once the machine picks the item with the lowest value, the next X items it pulls must have the same Ref as the one it selected. The value for X is defined in a global table, which has 6 columns, one for each Ref. This means that each Ref has a different X value associated with it. After those items are pulled, the system should repeat the same criteria. How can I implement this?

FlexSim 23.0.15
pullbatch pulling
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Ane, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

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

I would suggest the following:

Create two labels on the processors. One will denote which type should currently be pulled. The other is a counter to know when to switch types again. Have both labels start at zero.

Activate the "Pull" logic on the processor. In the "Pull Requirement" code two things happen. If the type label on the processor is currently 0, a new type to pull is chosen and the counter label is set to the target quantity for that type. The type label on the processor is then compared to the type of the item to only pull the correct type.

if(current.MatchType == 0)
{
    // There is currently no type defined - choose one
    // Here I just choose a random type
    current.MatchType = duniform(1, 6, getstream(current));
   
    // Set the counter label according to the global table
    current.TypeCounter = Table("PullsPerType")[1][current.MatchType];
}

// Match the item type with the current label
return item.Type == current.MatchType;

In the On Entry trigger of the processor, the counter label is decremented and the type label is reset when it reaches 0.

pull-batches.fsm


pull-batches.fsm (28.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.