question

Kevin Megee avatar image
0 Likes"
Kevin Megee asked Jeffin G commented

queue batching

I'm trying (wanting) to make a single queue batch 4 items, then 2, then 1, Or any sort of different batch sizing. Is this possible?

FlexSim 17.1.2
queuebatching
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

·
Ben Wilson avatar image
1 Like"
Ben Wilson answered Jeffin G commented

Hi @Kevin Megee,

I've attached a sample model, built in FlexSim version 17.1, with a queue that rotates through batch sizes 4, 2, and 1:

In this sample model, all modifications are on the queue.

The queue is set to perform batching, and flush between batches:

The queue has two labels. One is an array giving the batch sizes. The other keeps track of where we are in the array - specifying which index of the array is giving us our current batch size.

The queue has three triggers set. These were all done with the standard pick options, and I'll explain each:

OnReset - the reset trigger uses the standard Set Label option to set the BatchSizeIndex label to 0. When you start the model, it will always start at the beginning of the BatchSizeRotation array.

OnEntry - whenever a part enters the queue, we update the batch size (using the option for Update Queue's Batch Size) according to what value is read out of the labels. This is how we access the labels to look up the new batch size:

current.BatchSizeRotation[current.BatchSizeIndex+1]

This command gets the value from the queue's BatchSizeRotation label array, at index BatchSizeIndex+1 (add one since FlexSim arrays are 1-indexed, but our BatchSizeIndex value is 0 indexed).

Also, purely for visual demonstration, I set the color of the item, using the standard option Set Color By Case, where the case is based on the value BatchSizeIndex+1:

current.BatchSizeIndex+1


OnEndCollecting - when a batch is complete, we need to increment our BatchSizeIndex label to go on to the next batch size. We do this with the trigger option to Increment Value. However, we need the value to wrap back to 0 once it goes past the length of the BatchSizeRotation array. This is a 2nd trigger option (Set Label) added to the trigger, where we do a bit of modulo math:

fmod(current.BatchSizeIndex, current.labels["BatchSizeRotation"].value.length)

Here we use the fmod command to get the remainder found when dividing the value of BatchSizeIndex by the size of the BatchSizeRotation array. This is how we get the BatchSizeIndex value to stay in the range 0-2. Once it is incremented to 3, we then divide by 3 and take the remainder (0) and set that back to the BatchSizeIndex label.

Comment back with any related follow-up questions - or start a brand new question if you're moving on to another part of your model.


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

Kevin Megee avatar image Kevin Megee commented ·

Thanks a lot, this is perfect

0 Likes 0 ·
Jeffin G avatar image Jeffin G commented ·

hi,

I am pretty new to flexsim and want to know how to label a batch of items and get its value incremented per each batch also on how to assign it to a global table and later call the values from table for packaging into totes based on dimensions.

0 Likes 0 ·

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.