Here we will build a model that uses lists for routing items in a simple job shop model. The following image shows the basic layout, namely a source, 8 processors, and a finish queue.
As the image shows, there are basically four types of operations:
- Alpha - 2 Stations
- Beta - 2 Stations
- Gamma - 2 Stations
- Delta - 2 Stations
In this model we will have 3 different types of products, designated by item type. Each type has a unique sequence of operations that must be performed on the part before it is finished. The following table shows the manufacturing steps required for each type.
Model Building Steps
- Add an Item List - In the Toolbox, press the button and choose Global List > Item List from the drop-down menu. This will add an Item List to the model. For now you can close the List properties window.
- Add the Steps Table - In the Toolbox, press the button and choose Global Table from the drop-down menu. In the table view, define the name of the table as "Steps" and give it the following data:
- Create a Source - Create a source object in your model.
- Define Source Properties - Double-click on the source.
- Give the source an Inter-Arrivaltime of
exponential(0, 30, 0)
. - Select the Flow tab. Under Send To Port, press the drop-down button and choose Use List > Push to Item List.
Make sure that the list name matches the name of the list you added.
- Select the Triggers tab in the Source properties. In the OnCreation, add triggers to set a label named stepRow to 1, and set item type and color to
duniform(1, 3)
.The stepRow label will designate the row in the Steps table that the item is currently on. After each operation, the stepRow label will be incremented.
- Give the source an Inter-Arrivaltime of
- Define List Fields - Go back to the Item List's properties (double-click the Item List in the ToolBox). For this model we will use the following fields:
- stepRow - This field will reference the current stepRow label on the item. We'll use this to prioritize items who are further into their process (ORDER BY stepRow DESC).
- step - This field will reference the name of the current step that the item is on, e.g. Alpha, Beta, Gamma, or Delta. We will use it to match against the station that will pull from the list.
- itemType - This field will not be used in any queries. Rather it will be used to better visualize the items that are on the list.
- In the Item List's Fields tab, remove all fields but itemType
- Add a Label field named stepRow.
- Add an Expression field and give it the expression
gettablestr("Steps", getlabel(value, "stepRow"), getitemtype(value))
.
In expression fields you use "value" to access the primary value on the list. This expression gets a value from the Steps table (gettablestr("Steps",
... ) where the row is the item's current stepRow (getlabel(value, "stepRow")
), and the column is the item's type (getitemtype(value)
) - Press Apply in the List properties window.
- Do a Quick Test Model Run - In the General tab of the List properties, click View Entries... to open a window showing current entries on the list. Reset and run the model just to test that the source is properly assigning the data and pushing the item onto the list. After the source's first inter-arrival time has expired, the list should get an item on it.
- Create a Processor Object - Drag a processor object from the library into the model.
- Define Processor Properties - Double-click on the processor.
- Name the process Alpha1
- Give the processor a string label named operation. Set the value to Alpha.
- Select the Flow tab. Under Send To Port, press the drop-down button and choose Use List > Push to Item List.
Make sure that the list name matches the name of the list you added.
- In the Input pane, check Pull, then under Pull Strategy, press the drop-down button and choose Use List > Pull from Item List.
Make sure that the list name matches the name of the list you added, and define the Query as
WHERE step == Puller.operation ORDER BY stepRow DESC
.This will make the processor only pull items from the list whose step field matches the processor's operation label. It will also prioritize items with the highest stepRow label, i.e. items that are further along in their steps.
- Select the Triggers tab. In OnProcessFinish, add a trigger to set the stepRow label. In the Value field for the trigger, enter the code
getlabel(item, "stepRow") + 1
.
- Define Remaining Processors - Now that you've defined the processor object, you can copy/paste the other processors from that object. Define a second Alpha processor (copy/paste it). Define two Betas, two Gammas, and two Deltas by copy/pasting the original processor, and change the pasted objects' operation label to its corresponding operation (Beta, Gamma or Delta).
- Add a Finish Queue - Drag a queue from the library. The queue will have much of the same properties as the processors. It will be the queue to dump the items when they reach their Finish step.
- Name the queue Finish
- Give it an operation label with the value Finish
- In its Flow tab, check Pull and under the Pull Strategy choose Use List > Pull from Item List.
- Define the pull query as
WHERE step == Puller.operation
. We don't need to prioritize here because it's essentially a sink.
- Run the Model - Now you should be able to reset and run the model. You may also want to go back to the Item List and view its back orders. Right-click on the list in the Toolbox, and select View Back Orders.
As the model runs you should see items moving through the various processors in the order defined in their associated Steps table column (red = type 1, green = type 2, blue = type 3).