question

Kyle S avatar image
0 Likes"
Kyle S asked Kyle S commented

Matching Labels with Source Batching

I am currently replicating a process where deliveries arrive in batches. I am using the source batching feature to set the quantities in each delivery (quantities in each delivery are the same). The items in each delivery are the same but the item type is unknown until it arrives. The items then are palletized (Combiner) and sent to the next step based on the item type. I am trying to assign labels to the batch of pallets so all pallets in each batch have matching labels but when using the assign label function it is assigning different labels for each item in the batch. How can I get each batch the have matching labels based on a random delivery schedule? Model is attached below.

FlexSim Model.fsm

FlexSim 24.0.3
batchingset labelitem labels
flexsim-model.fsm (29.9 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.

1 Answer

Jeanette F avatar image
1 Like"
Jeanette F answered Kyle S commented

Hello @Kyle S,

You can set a label on the source that sets the Type label once every batch size and all the flow items of that batch receive the same type label.

 { 
/**Custom Batch Set Label and Color*/

int batchSize = 5;
int curItemNum = Math.fmod(current.stats.output.value+1, batchSize);
Object involved = item;
string labelname = "Type";

if(curItemNum == 1){
current.f_curlabel = duniform(1, 4, getstream(current));
}

Variant value = current.f_curlabel;
involved.color = Color.fromPalette(value);
involved.labels.assert(labelname).value = value;

} 

flexsim-model_1.fsm


flexsim-model-1.fsm (30.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.

Kyle S avatar image Kyle S commented ·
Thank you
0 Likes 0 ·