Phase 1. Creating a simple
We’ll start by creating a simple model that will simulate the
arrival at the
job shop, their storage at the shipping dock and their arrival at the
We will use the following layout:
Right-click the image above, click Save
image as and select the location for the image file.
- Create a new model. In the New Model wizard,
set the Model name:
and Model time units:
- Open the Presentation
palette has several shapes that you
use to draw model animation, including a rectangle, a line, an oval, a
and a curve.
- On the Presentation
palette, select the Image
and then drag it
diagram. You can use the Image
shape to add images in several
graphic formats – including PNG, JPEG, GIF, and BMP – to your
- You’ll see the dialog box that prompts you to choose the
image file the shape will display. Browse to
the location of the image file you saved earlier.
After you select the layout.png image, our diagram of the Main agent type
should look like the following image:
AnyLogic adds the image in its original size onto the Main diagram, but
you can also change the image’s width or length. If you distort the
image’s proportions as in the figure below, you can revert to the
image’s original size by
opening the Properties
view and clicking Reset
to original size.
- Select the image in the graphical editor. In the Properties
view, select the Lock
check box to lock the image.
can lock a shape to ensure it doesn’t respond to your
mouse click and you can’t select it in the graphical editor. You’ll
find this very helpful as you draw shapes on top of layouts that
represent facilities such as factories or hospitals.
- If you need to unlock a shape, right-click in the graphical
editor and select Unlock
All Shapes from the menu.
Our next step is to use the Space Markup palette
to place space markup shapes on top of the job shop’s layout. The
palette includes a Path
element, three Node
elements, an Attractor
element, and Pallet Rack
markup elements that define the locations of agents:
- A Node
is a place where agents may reside or perform an operation.
- A Path
is a route that agents can use to move between nodes.
Together, nodes and paths make up a network that a
model’s agents can use to move along the shortest paths between their
origin and destination nodes. You’ll usually create a network when your
model’s processes take place in a defined physical space and it has
moving agents and resources. It is assumed that network segments have
unlimited capacity, and the agents do not interfere with one another.
Now that you know a little bit about networks and their
component parts, we’re ready to create a network that will define the
movement paths for our model’s pallets. The first step is to use
rectangular nodes to define specific areas on the job shop’s layout.
Draw the rectangular node over the job shop’s entrance, as
shown in the figure below, to represent our model’s pallet receiving
- Open the Space
Markup palette, and drag the Rectangular Node element
diagram. Resize the node. The node should look as in the figure below.
- Name the created node receivingDock.
- Draw a node to define the location where the model’s agents
will park forklift trucks once the trucks are idle or the agents no
longer need them to complete a task. Use another Rectangular
draw the parking area as shown in the figure below and then name this
Let’s draw a movement path to guide our model’s forklift trucks.
- Do the following to draw a movement path that will guide
our model’s forklift trucks:
- In the Space
Markup palette, double-click the Path element
to activate its
- Draw the path as shown in the figure below by clicking
border, clicking in the diagram to add the path’s turning point and
then clicking the forkliftParking
If you’ve successfully connected the nodes, the path’s
connection points will display cyan highlights each time you select the
By default, paths are bidirectional.
However, you can
limit movement along a selected path to one direction by clearing the Bidirectional
property and then defining the movement direction. You can view a given
path’s direction by selecting the path and then viewing the direction
arrow that displays in the graphical editor.
- Define your model’s warehouse storage by dragging the Pallet Rack element
from the Space Markup
on to the layout and placing its aisle on the path. A correctly-placed
pallet rack will display a green highlight that shows it is connected
to the network.
The Pallet Rack space
graphically represents the pallet racks you often see in warehouses and
storage zones. As you can see below, the element has three alternative
During runtime, the Pallet
Rack element manages the agents that the model stores in
the single-level or multiple level cells that are available on side(s)
of the aisle.
- In the pallet rack’s Properties
area, do the following:
- Set Type
to: two racks, one aisle
- Number of
In the Position
and size section:
pallet rack depth: 14
pallet rack depth: 14
- After you’ve completed these changes, the pallet rack
should resemble the pallet rack shown in the figure below. If
necessary, move the pallet rack so that its center aisle lies on the
path. Make sure the pallet rack is connected to the network by clicking
it twice to select it. Your first click will select the entire network,
and the second will select the pallet rack. The pallet rack should
display a green highlight that shows it is connected to the network.
We’ve marked up our model’s space by drawing the important
locations and paths on top of our layout, and we’ll now use the
Modeling Library to model the processes.
The blocks in AnyLogic’s Process
allow you to use combinations of agents,
resources, and processes to create process-centric models of real-world
systems. You learned about agents and resources earlier in this
section, and we’ll build upon that foundation by defining processes as
operations sequences that include queues, delays, and resource
Your model’s processes are defined by flowcharts, the
graphical process representations you construct from the Process
Modeling Library’s blocks. In the following steps, you’ll create the
- Drag the Source element
from the Process Modeling Library
palette on to the graphical diagram and name the block sourcePallets.
While the Source
block usually acts as a process starting
point, our model will use it to generate pallets.
- In the sourcePallets
area, do the following to ensure the model’s pallets arrive every five
minutes and appear in the receivingDock
- In the Arrivals
defined by area, click Interarrival
- In the Interarrival
time box, type 5,
and select minutes
from the list on the right to have pallets arrive every five minutes.
- In the Location
of arrival area, click Network
/ GIS node in the list.
- In the Node
area, click receivingDock
in the list.
refer to model elements from block’s parameters
The block’s parameters offer two ways to select a graphical
- You can select a graphical element from the list of
available and valid elements that displays beside the parameter.
- You can select a graphical element by clicking the
selection button that displays beside the list. If you click the
selection button, it will limit your choices to the available and valid
elements that you can select by clicking in the graphical editor:
Continue constructing the flowchart by adding other Process Modeling Library
- Drag the RackStore block
from the Process
palette onto the diagram and place it near the sourcePallets block
so they are automatically connected as shown in the diagram below.
block places pallets into a given pallet rack’s cells.
- In the rackStore
area, do the following:
- In the Name
box, type storeRawMaterial.
- In the Pallet
rack / Rack system list, click palletRack.
- In the Agent
location (queue) list, click receivingDock to
specify the location where agents wait to be stored.
- Add a Delay block
to simulate how
pallets wait in the rack and then name the block rawMaterialInStorage.
You've probably noticed that AnyLogic automatically
connects the block's right port to the following block's left port.
Each Process Modeling Library block has a left input port and a
right output port,
but you should only connect input ports to output ports.
- In the rawMaterialInStorage
area, do the
- In the Delay
time box, type triangular(15,
20, 30) and
select minutes from the list.
- Select the Maximum
capacity check box to ensure agents
will not get stuck as they wait to be picked up from storage.
- Add a RackPick block,
connect it to
the flowchart, and then name it pickRawMaterial.
In our model, the RackPick
block removes a pallet from a cell in the pallet rack and then moves it
to the specified destination.
- In the pickRawMaterial
area, do the following:
- In the Pallet
rack / Rack system list, click palletRack to
select the pallet rack that will provide pallets to agents.
- In the Node
list, click forkliftParking
to specify where the agents should park forklift trucks.
- Add a Sink block.
agents and is usually a flowchart's end point.
- We’ve finished building this simple model, and you can now
run it and observe its behavior. Click the Run
button and choose the experiment you want to run from
drop-down list. Your simulation experiment is called Job Shop/Simulation.
- You will see the model window. Click the Run button in the control panel displayed at the window bottom.
If the Exception
during discrete event execution error message displays,
you must connect your pallet rack to the network. You should select the
pallet rack shape in the graphical editor, move it until the pallet
rack’s aisle displays a green highlight that shows it has connected to
the network, and then rerun the model.
Job Shop Model
2. Adding resources