Phase 1. Creating a simple model

We’ll start by creating a simple model that will simulate the pallets’ arrival at the job shop, their storage at the shipping dock and their arrival at the forklift area.

We will use the following layout:

Right-click the image above, click Save image as and select the location for the image file.
  1. Create a new model. In the New Model wizard, set the Model name: Job Shop, and Model time units: minutes.
  2. Open the Presentation  palette. The palette has several shapes that you can use to draw model animation, including a rectangle, a line, an oval, a polyline and a curve.
  3. On the Presentation palette, select the Image  shape and then drag it on to the Main diagram. You can use the Image shape to add images in several graphic formats – including PNG, JPEG, GIF, and BMP – to your presentation.

  4. 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.

  1. Select the image in the graphical editor. In the Properties view, select the Lock check box to lock the image.

Locking shapes

Space markup elements

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 shapes.

Creating a network

Paths and nodes are space markup elements that define the locations of agents:

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 dock.

  1. Open the Space Markup palette, and drag the Rectangular Node  element onto the Main diagram. Resize the node. The node should look as in the figure below.


  2. Name the created node receivingDock.
  3. 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 Node  to draw the parking area as shown in the figure below and then name this node forkliftParking.


    Let’s draw a movement path to guide our model’s forklift trucks.
  4. Do the following to draw a movement path that will guide our model’s forklift trucks:
    1. In the Space Markup palette, double-click the Path  element to activate its drawing mode.
    2. Draw the path as shown in the figure below by clicking the receivingDock border, clicking in the diagram to add the path’s turning point and then clicking the forkliftParking node’s border.

    If you’ve successfully connected the nodes, the path’s connection points will display cyan highlights each time you select the path.


    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.

  5. Define your model’s warehouse storage by dragging the Pallet Rack  element from the Space Markup palette 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.

Pallet rack

The Pallet Rack  space markup element graphically represents the pallet racks you often see in warehouses and storage zones. As you can see below, the element has three alternative configurations.

 

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.

  1. In the pallet rack’s Properties area, do the following:
    1. Set Type to: two racks, one aisle
    2. Number of cells: 10
    3. Level height: 10

                In the Position and size section:

    1. Length: 160
    2. Left pallet rack depth: 14
    3. Right pallet rack depth: 14
    4. Aisle width: 11
  2. 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 AnyLogic Process Modeling Library to model the processes.

Process Modeling Library

The blocks in AnyLogic’s Process Modeling Library 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 utilization.

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 process flowchart.

  1. 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.

  2. In the sourcePallets block’s Properties area, do the following to ensure the model’s pallets arrive every five minutes and appear in the receivingDock node.
    1. In the Arrivals defined by area, click Interarrival time.
    2. In the Interarrival time box, type 5, and select minutes from the list on the right to have pallets arrive every five minutes.
    3. In the Location of arrival area, click Network / GIS node in the list.
    4. In the Node area, click receivingDock in the list.

               

How to refer to model elements from block’s parameters

The block’s parameters offer two ways to select a graphical element:

Continue constructing the flowchart by adding other Process Modeling Library blocks:

  1. Drag the RackStore  block from the Process Modeling Library palette onto the diagram and place it near the sourcePallets block so they are automatically connected as shown in the diagram below.

    The RackStore block places pallets into a given pallet rack’s cells.

  2. In the rackStore block’s Properties area, do the following:
    1. In the Name box, type storeRawMaterial.
    2. In the Pallet rack / Rack system list, click palletRack.
    3. In the Agent location (queue) list, click receivingDock to specify the location where agents wait to be stored.


  3. 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.

  4. In the rawMaterialInStorage block’s Properties area, do the following:
    1. In the Delay time box, type triangular(15, 20, 30) and select minutes from the list.
    2. Select the Maximum capacity check box to ensure agents will not get stuck as they wait to be picked up from storage.

  5. 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.


  6. In the pickRawMaterial block’s Properties area, do the following:
    1. In the Pallet rack / Rack system list, click palletRack to select the pallet rack that will provide pallets to agents.
    2. In the Node list, click forkliftParking to specify where the agents should park forklift trucks.

  7. Add a Sink  block. The Sink block disposes agents and is usually a flowchart's end point.

  8. We’ve finished building this simple model, and you can now run it and observe its behavior. Click the Run toolbar button and choose the experiment you want to run from the drop-down list. Your simulation experiment is called Job Shop/Simulation.
  9. 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.

Reference model: Job Shop - Phase 1


          Job Shop Model

          Phase 2. Adding resources