Create New Factory Extension
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
Open the extensions editor
- Choose Extensions
> Create New... from the main menu to open the
- In the Create New Extension
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
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
Open Factory diagram
Now take a closer look at the existing flowchart.
- Double-click the NewFactory
item to open its graphical diagram, containing the structure of the Factory extension.
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 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
Add quality check to the factory
- 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
- 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 thebatchProduction
and the qualityCheck
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
That's it. We have added the quality check control to the
flowchart. Now we can add the Delay
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
of the batchProduction
and the isLastBatch
- Drag down the connector's left point with the left mouse
- In the same way adjust the position of the connector's
- When done, click in the graphical editor to deselect the
Let us add the Delay
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
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.
scenario and observe results | Phase
3. Export the modified extension