In the previous phase we imported the supply chain scenario, ran the experiment and observed the results. In this phase we will create a new factory extension, add quality control and overhaul processing to it to maintain high quality of the produced headphones.
Let us start with opening the extensions editor.
Open the extensions editor
- Choose Extensions > Create New... from the main menu to open the dialog box.
- In the Create New Extension dialog box select the Factory
extension by clicking the checkbox next to it.
- Click OK to close the dialog box and launch AnyLogic.
The selected object will be available in the Projects palette of the extensions editor.
To keep the initial extension intact, we will save our modified version to a new extension.
Rename the extension
- Expand the Factory extension model and click the
TemplateFactory item to open its properties.
Navigate to the Properties palette in the right part of AnyLogic layout, change the name of the extension to NewFactory and press Ctrl + Enter to save the name and replace all name occurrences.
Now we may modify the new extension. We want the factory to perform quality check and improve the quality of the product if required. This will require us to modify the flowchart of the extension. First, let us open the graphical diagram of the Factory extension and examine the existing flowchart.
Open Factory diagram
- Double-click the NewFactory item to open its graphical diagram,
containing the structure of the Factory extension.
Now take a closer look at the existing flowchart.
The flowchart defines the logic of the factory:
- The Production Planning block receives demand from the downstream supply chain and generates production orders.
- The Plain Transfer block arranges the required amount of raw materials.
- The Batch Size Selector block splits production orders into batches.
- The Initial order enter block — loads the initial state of production
- The Seize block seizes the production line.
- The Delay block models batch production.
- The Plain Transfer block adds the produced amount to inventory and updates statistics.
- The Select Output block checks if the production order is produced.
- The Release block releases the production line if the order is produced.
- The Sink block completes the production process and updates statistics.
Let us start modifying the flowchart by adding the quality check control, which will be modeled by the Select Output block.
Add quality check to the factory flowchart
- Create space for the new block on the existing flowchart by selecting the loadProduct block and dragging it to the right.
- Then select the batchProduction block and drag it to the left.
There, we now have enough room for the new block.
- Now switch to the Palette view by clicking the Palette
tab and navigate to the Process Modeling Library palette.
- Drag the Select Output block from the library palette onto the graphical editor and place it between the batchProduction and the loadProduct blocks. The ports of the new block will be automatically connected.
- Navigate to the properties of the block and name it qualityCheck.
- Set the probability of producing high quality headphones to 90% by typing
0.9 in the Probability parameter field.
That's it. We have added the quality check control to the factory flowchart. Now we can add the Delay block to model the overhauling of the headphones that failed to pass the quality check. But first, we will create space for the new block.
Create space for the Delay block
- Select the connector of the batchProduction and the isLastBatch blocks.
- Drag down the connector's left point with the left mouse button pressed.
- In the same way adjust the position of the connector's right point.
- When done, click in the graphical editor to deselect the connector.
Let us add the Delay block now.
Modify the flowchart
- Navigate to the Process Modeling Library palette.
- Drag the Delay block from the palette onto the graphical editor and place it below the
qualityCheck block. The ports of the two blocks will be automatically connected.
- Navigate to the block's properties and name it overhaul.
- Set the triangular distribution of the Delay time parameter to
25, 30, 40, and set its time measurement unit to minutes.
In such a way we define the time the production line will spend on overhauling the products, which failed to pass the quality check.
- Now connect the exit port of the Delay block to the input port of the qualityCheck block.
Start drawing the connector by double-clicking the exit port, then click at each connector's turning point as shown on the screenshot below.
Complete drawing the connector by clicking the input port of the required block.
- Save the extension by clicking the
Save model toolbar button.
That's it. We have completed the second phase of this tutorial. We have created a new factory extension, added the quality check and the overhaul processes to its flowchart. Click the link below to proceed to Phase 3 of this tutorial, in which we will export the extension to anyLogistix.
How can we improve this article?