Matching Labels with Source Batching

Matching Labels with Source Batching

kyle_schultzSB6JD
Participant Participant
213 Views
2 Replies
Message 1 of 3

Matching Labels with Source Batching

kyle_schultzSB6JD
Participant
Participant

[ FlexSim 24.0.3 ]

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

0 Likes
Accepted solutions (1)
214 Views
2 Replies
Replies (2)
Message 2 of 3

Jeanette_Fullmer
Community Manager
Community Manager
Accepted solution

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

Message 3 of 3

kyle_schultzSB6JD
Participant
Participant
Thank you
0 Likes