Modeling How-To's > Modeling Activities > Condition Dependent Batching

Condition Dependent Batching

Consolidate Entities into a Batch that have accumulated only until a condition becomes true (e.g., until a resource is available or until a truck has arrived).

 

The model used for this example, as well as all of the modeling "how-to" examples, can be found in the ProModel Solutions Café (http://www.promodel.com/solutionscafe/howto/). A video demonstrating this solution can be found here.

Solution

  1. Define a global variable representing the condition to be met (e.g. vCondition).
  2. Define another global variable representing the count of entities waiting to be batched (e.g., vCount).
  3. Define another global variable representing the quantity of entities that will finally be batched (e.g., vBatchQty)
  4. Define an Inventory Buffer equal to the largest permissible batch size plus any extra waiting entities.
  5. INCrement the vCount variable in the Inventory logic.
  6. DECrement the vCount variable on the route exiting the Inventory so you always have an accurate count of entities in the Inventory.
  7. In the batching activity, click on the Batching button and select Batch.
  8. For the batch size, enter the name of the variable representing the batch quantity (e.g. vBatchQty).
  9. Create a trigger entity/activity combination with a single 1 time periodic arrival (1 entity entering a single activity not connected to any other activities in the model).
  10. Click on the Logic button in the trigger activity properties dialog.
  11. In the Logic Builder, define the following:

While (Clock(min) >= 0) Do

{

Wait Until (vCondition = 1)

If (vCount < 10)

{

Wait Until vCount >= 10

}

If (vCount >= 10 And vCount <= 20)

{

vBatchQty = vCount

Send vBatchQty Work Unit To Oven

}

Else

{

vBatchQty = 20

Send 20 Work Unit To Oven

}

vCondition = 0

}

Example

At least 10, but no more than 20 completed parts are accumulated in a Buffer and then placed as a batch in an Oven for heat treatment whenever the Oven has completed a previous batch.

Solution

Batch Trigger logic is shown below.

Exit route logic is shown below.

Notice that in the logic for the routing dialog going out of the Oven, the vCondition variable is set to 1 indicating that the oven is now ready and available for the next batch of parts. Be sure to set the initial value of vCondition to 1 so that the first batch of 10 will be allowed to move to the Oven.


© 2011 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com