How do I batch by multiple labels in a single batch process block?

How do I batch by multiple labels in a single batch process block?

alexander_muff
Not applicable
2,378 Views
16 Replies
Message 1 of 17

How do I batch by multiple labels in a single batch process block?

alexander_muff
Not applicable

I am trying to batch by two labels: setID and type. There are 3 unique type's. The setID will increase indefinitely as the model runs. You can't batch different setID's together.

Type 1Type 2Type 3
Qty/set231
batchSize221
setIDindexes every 2 tokensindexes every 3 tokensindexes every 1 tokens

In the attached model. I have written the ProcessFlow to include separate process streams. How do I combine this batch logic into a single batch process block?

Example: GroupBy: type AND setID

0 Likes
Accepted solutions (1)
2,379 Views
16 Replies
Replies (16)
Message 2 of 17

sam_stubbsYXX86
Alumni
Alumni

It looks like you forgot to attach the file you were referencing. It's hard to say, but it sounds like you'd rather use a list than a complicated batching process. With a list you push your items to the list, and the pull the desired amount from a pull activity. Using a query you can designate which item you want to pull by itemtype as well.

Message 3 of 17

alexander_muff
Not applicable

Attached file.batching-test-model.fsm

0 Likes
Message 4 of 17

sam_stubbsYXX86
Alumni
Alumni

Just to clarify: Your "set" is a batch of batches? For example are you saying that Type 2 items are batched by 2s, and that a set is 3 batches? (6 items in total?).

0 Likes
Message 5 of 17

alexander_muff
Not applicable

The set is is the identifier of parent assembly. Set1 parts can't be batched with Set2 or Set3.

Example: Car1 and Car 2 both need four wheels. But they are unique to each car. So the first 4 wheels into the system are designated as Set1 and can't be processed with Set2 wheels.

SetIDtype
Batch111
Batch212
Batch313
Batch421
Batch522
Batch623
Batch731
0 Likes
Message 6 of 17

sam_stubbsYXX86
Alumni
Alumni

I'm really sorry, I guess I still don't understand what it is you're trying to do. Are you trying to combine 1 of each of the batch types into a "set" batch? I'm not sure I still understand your issue, I apologize.

0 Likes
Message 7 of 17

jeff_nordgren
Not applicable
Accepted solution

@Alexander Muff,

Attached is your model with the blocks that I added in the Process Flow. If I'm understanding what you are wanting to happen, this should do that. I added more fields to your global table to help in figuring the setID label. So what happens is that each item type is batched into the BatchSize in the global table. Each new batch is given a new setID or batch ID. When a token goes into the Delay block, there should only be one token representing the batch (setID).

Take a look at the model and see if this is what you were wanting to do. Let me know if you have any questions or problems.

batching-test-model-jn1.fsm

Alexander,

I've taken the added information you gave above and modified my model. I added a global table (2) that has the "Color" and "Shape" information in it. I use numeric fields because they are a lot easier and more efficient to use that string fields. So really the numbers represent colors and shapes. In the table there are 9 different combinations of colors and shapes.

For each combination of colors and shapes, the row of the table represents the "Type" of unique combination.

Take a look at the attached model and see if it now does what you are wanting it to do. I will create 9 different types of batches (combinations) with the batch sized determined by the global table. And for each "Type", it keeps tracks of a unique SetID (number of batches created for that Type).

batching-test-model-jn2.fsm

Message 8 of 17

alexander_muff
Not applicable

I am trying to batch based on 2x different labels.

Let's say I have one label Color and another label Shape. Colors can be red, blue, yellow and shapes can be circle, square, triangle. I need to batch by Color AND Shape.

Possible combinations:

ColorShape
RedCircle
RedSquare
RedTriangle
BlueCircle
BlueSquare
BlueTriangle
YellowCircle
YellowSquare
YellowTriangle

Each one of these rows would be a "Batch Group".

A blue square can only be batched with blue squares.

0 Likes
Message 9 of 17

alexander_muff
Not applicable

I have attached an example model. It batches by colorLabel only. I need it to batch by colorLabel and shapeLabel.

Example: all blue squares would be batched together.

batching-by-2x-labels.fsm

0 Likes
Message 10 of 17

alexander_muff
Not applicable

@Jeff Nordgren

When I run the JN2 model, an infinite number of tokens are created at time 0.0. (See attached)

Also, this works when both labels have a finite range. Is it possible to create code when one of the labels is infinite? Instead of 1-3, it was always increasing as you create more.

0 Likes
Message 11 of 17

alexander_muff
Not applicable

Attached picture for prior comment

5455-capture.pnga

0 Likes
Message 12 of 17

jeff_nordgren
Not applicable

@Alexander Muff,

Not sure what you changed in the JN2 model to get that many tokens. When I run the model, it runs just fine.So I'm not sure what is up with that. Maybe someone else reading this can try it out and comment?

Of course the labels have to have a finite range. Nothing is infinite, except maybe space. You would have to explain to me how something infinite would work. I don't know of any business that produces an infinite number of anything. I need more information why you say that and what you are looking to do.

There needs to be a finite global table. That is where the the information is kept on the batch size and SetID for the various batch combinations. The tokens created only reflect the different batches in the table. They are connected, not separate. How would you make something like that infinite? There is not enough memory in any computer to hold infinite information because that does not exist. If you put a computer into an infinite loop, it will crash.

0 Likes
Message 13 of 17

alexander_muff
Not applicable

@Jeff Nordgren,

I downloaded the model again and it is working.

When I say infinite, it means always increasing. For example the serial number for an individual car at a car plant. They are producing several thousand cars a day. The serial number is always increasing. Is there way to generate a increasing serial number and batch by serial number and other labels? I'm not sure it's feasible to do this with a table with defined serial number.

0 Likes
Message 14 of 17

alexander_muff
Not applicable

@Jeff Nordgren,

I downloaded the model again and it is working.

When I say infinite, it means always increasing. For example the serial number for an individual car at a car plant. They are producing several thousand cars a day. The serial number is always increasing. Is there way to generate a increasing serial number and batch by serial number and other labels? I'm not sure it's feasible to do this with a table with defined serial number.

0 Likes
Message 15 of 17

jeff_nordgren
Not applicable

@Alexander Muff,

There are probably several way of creating an ever increasing value. For one, you could, at the end of a particular model run, save those value(s) in an Exel file. And when starting the model again, read in the last value(s) for your labels (or whatever) and continue on from there. Not knowing exactly what you are wanting to save and when, that is my general answer. But yes, something like that would be fairly easy to accomplish.

0 Likes
Message 16 of 17

alexander_muff
Not applicable

@Jeff Nordgren,

I am trying to batch by a label (color) and this increasing variable (serial#). That's why I am interested in making the batch on the fly instead of a pre-made table.

0 Likes
Message 17 of 17

jeff_nordgren
Not applicable

@Alexander Muff,

What I would do would be to put in a global table the label (color) and a beginning batch value (serial#). You could import this from a saved Excel file, if you want to keep a "total" running serial number or you could set it to some beginning number of your choice. Then in the Source, just increment that serial number (also a label on the flowitem) by whatever you need. Would something like that work for you?

0 Likes