Font size

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 to Job Shop, and Model time units to 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.

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

    Locking shapes

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

    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:

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

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

  7. Name the created node receivingDock.
  8. 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.
  9. 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 drawing mode.
    • 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.

  10. 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 the sides of the aisle.

  11. In the pallet rack’s   Properties view area, specify the following:
    • Set Type to: two racks, one aisle
    • Number of cells: 10
    • Level height: 10

    In the Position and size section:

    • Length: 160
    • Left pallet rack depth: 14
    • Right pallet rack depth: 14
    • Aisle width: 11
  12. 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 the   Process Modeling Library of AnyLogic 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 blocks. In the following steps, you’ll create the process flowchart.

  13. 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.
  14. In the sourcePallets block’s   Properties view, do the following to ensure the model’s pallets arrive every five minutes and appear in the receivingDock node.
    • In the Arrivals defined by area, click Interarrival time.
    • 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.

    How to refer to model elements from block’s parameters

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

    • 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 blocks.

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

  16. In the   RackStore block’s   Properties view, 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.

  17. 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.
  18. In the rawMaterialInStorage block’s   Properties view, do the following:
    • 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.

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

  20. In the pickRawMaterial block’s   Properties view, 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.

  21. Add a  Sink block. The   Sink block disposes agents and is usually a flowchart’s end point.

  22. We’ve finished building this simple model, and you can now run it and observe its behavior. Click the   Run toolbar button toolbar button and choose the experiment you want to run from the drop-down list. Your simulation experiment is called Job Shop/Simulation.
  23. You will see the model window. The model execution will launch immediately.

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.

How can we improve this article?