SIMUL8 Tip: Label-based Batching and Collecting
Using batching, we are able to split a single work item in our simulation into two or more items, which each share the same label attributes as the original work item. Batching is used where we have a single work item, such as a pallet of goods; which is then split into smaller items, for example, boxes.
Collecting, on the other hand, is the process of combining several work items into a single item. We may, as an example, collect 4 wheels and a chassis before combining them to make a single work item, which represents a car.
More details on the basics of batching and collecting can be found on the support section of our website.
However, what happens when we have split (batched) an item and want to re-combine (collect) the specific constituent parts, based on a particular identifier; rather than just collecting generic items from two or more queues? Label-based batching and collecting can help us solve this problem.
Let’s use an airport as an example. When you arrive at an airport, you will likely have a bag. At the point of arrival, you and your bag would be represented by a single work item. However, at the check-in stage, you and your bag are split, to follow separate routes to the airplane. Once the journey, Border Control and baggage handling (which represent processes applied to different work items) have completed; both you and your bag are routed towards Baggage Reclaim. At Baggage Reclaim, you (presumably!) don’t just grab the first bag which comes off the conveyor. Instead, you wait for your own bag, before collecting and moving on. Label based routing and collecting can help us model this.
First, we need to model our process:
Using the above model, we know that work items will enter the “Check In” activity as a single item; however, they will need to be split into a passenger item and a bag item when they exit. To do this, we use Batching Out. Before the batching out takes place, we need to ensure that both items are stamped with the same unique identifier, in order that they can be matched-up at Baggage Reclaim. We can use a Label to store the unique ID, so we need to create a Label and we’ll call it “lblID”. Next, we assign a unique value to lblID at the Start Point, so that when the item is split, both new work items will share the same unique ID:
Now that the work items (the bag and the passenger) both have the same unique identifier and have been separated at the Check In stage, we can match these up at the Baggage Reclaim stage. To do this, we need to create a Routing In rule on the Baggage Reclaim activity.
SIMUL8 will then only collect and assemble the passenger and bag once both are available, matching the two work items based on the unique ID number lblID. Note: Label-based rules should be used to ensure that passengers and bags follow the appropriate route through the model.