0

我有一条生产线,其中一些资源会产生成批的零件。“源”块创建的件数和批次数是参数。例如,如果您设置创建 48 件和 4 个批次,则每个批次在资源完成 12 件时关闭。例如,当我有 51 件和 4 个批次时,问题就出现了,在这种情况下,我应该有不同尺寸的批次,如 12、12、12 和最后一个有 15 件。有没有办法解决这个问题?感谢您的建议

4

1 回答 1

2

Following this Sample Model. Assuming all your parts arrive at the same time you just need to update the batchSize "On exit" at the source block with:

batchSize = numberOfParts/numberOfBatches;
batchparts.set_batchSize(batchSize);

And then, update it again "On exit" on the batch block:

if(queue.size()<2*batchSize){
batchSize=batchSize+(queue.size()%batchSize);
}
batchparts.set_batchSize(batchSize);

Note (queue.size()%batchSize) is the MOD function and gives you the additional number of parts needed to be batched in the last batch.

If the parts don't arrive at the same time, you can create a variable batchNumber that will let you know which number of batch you will do next (1 to numberOfBatches, initialized in 1).

Sample model 2

Then, you just need to update it on the "On exit" of the batch block as follows:

//If the next batch is the last one, batch all the 
//remaining quantity until completing the total number of parts
if(batchNumber+1=numberOfBatches){
    batchSize=batchSize+(numberOfParts%batchSize);
    batchparts.set_batchSize(batchSize);
    batchNumber=1;
}
batchNumber=batchNumber+1;

I hope this helps.

于 2020-06-05T23:57:38.837 回答