question

Alexander Muff avatar image
0 Likes"
Alexander Muff asked Jeff Nordgren commented

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

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 1 Type 2 Type 3
Qty/set 2 3 1
batchSize 2 2 1
setID indexes every 2 tokens indexes every 3 tokens indexes 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

labelsbatching
· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Sam Stubbs avatar image Sam Stubbs ♦ commented ·

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.

1 Like 1 ·
Alexander Muff avatar image Alexander Muff commented ·

Attached file.batching-test-model.fsm

0 Likes 0 ·
Sam Stubbs avatar image Sam Stubbs ♦ Alexander Muff commented ·

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 0 ·
Alexander Muff avatar image Alexander Muff commented ·

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.

SetID type
Batch1 1 1
Batch2 1 2
Batch3 1 3
Batch4 2 1
Batch5 2 2
Batch6 2 3
Batch7 3 1
0 Likes 0 ·
Sam Stubbs avatar image Sam Stubbs ♦ Alexander Muff commented ·

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 0 ·
Alexander Muff avatar image Alexander Muff Sam Stubbs ♦ commented ·

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:

Color Shape
Red Circle
Red Square
Red Triangle
Blue Circle
Blue Square
Blue Triangle
Yellow Circle
Yellow Square
Yellow Triangle

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

A blue square can only be batched with blue squares.

0 Likes 0 ·
Show more comments

1 Answer

Jeff Nordgren avatar image
1 Like"
Jeff Nordgren answered Jeff Nordgren commented

@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


· 8
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Alexander Muff avatar image Alexander Muff commented ·

@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 0 ·
Alexander Muff avatar image Alexander Muff Alexander Muff commented ·

Attached picture for prior comment

a

0 Likes 0 ·
capture.png (29.9 KiB)
Jeff Nordgren avatar image Jeff Nordgren Alexander Muff commented ·

@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 0 ·
Show more comments
Alexander Muff avatar image Alexander Muff commented ·

@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 0 ·
Jeff Nordgren avatar image Jeff Nordgren Alexander Muff commented ·

@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 0 ·
Alexander Muff avatar image Alexander Muff Jeff Nordgren commented ·

@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 0 ·
Show more comments