Font size

Phase 2. Adding resources

Let’s continue developing our model by adding resources — forklift trucks — to store the pallets in the storage and then move them to the production area.


Resources are objects that agents use to perform a given action. An agent must obtain the resource, perform the action, and then release the resource.

Some examples of resources include:

  • A hospital model’s doctors, nurses, equipment, and wheelchairs
  • A supply chain model’s vehicles and containers
  • A warehouse model’s forklift trucks and workers

There are three types of resources: static, moving, and portable.

  • Static resources are bound to a specific location, and they cannot move or be moved.
  • Moving resources can move independently.
  • Portable resources can be moved by agents or by moving resources.

In AnyLogic, the   Process Modeling Library   ResourcePool block defines each set or pool of resources. Resource units can have individual attributes, and each resource has a graphical diagram where you can add elements such as statecharts, parameters, and functions.

Our model’s resources are the forklift trucks that move pallets from the unloading zone to a pallet rack and then deliver pallets from the rack to the production zone.

  1. On the   Process Modeling Library palette, drag the   ResourcePool block on to the   Main diagram. You do not have to connect the block to the flowchart.

  2. Name the block forklifts.

  3. In the forklifts block   Properties view, click create a custom type. This way we create a new type of a resource.
  4. In the New agent wizard:
    • In Agent type name box, type ForkliftTruck.
    • Click Next.

    • On the next page, in the list in the left part of the wizard, expand the Warehouses and Container Terminals area, and then click the Fork Lift Truck 3D animation figure.

    • Click Finish.
  5. The ForkliftTruck agent type diagram will open and display the animation shape you selected in the wizard.

  6. Click the   Main tab to open the   Main diagram.

    You’ll see the ForkliftTruck resource type has been selected in the   ResourcePool block’s New resource unit parameter.
  7. Modify the forklifts block’s other parameters:
    • In the Capacity box, type 5 to set the number of forklift trucks in our model.
    • In the Speed box, type 1 and choose meters per second from the list on the right.
    • In the Home location (nodes) area, select the forkliftParking node.
      Click the plus button and then click forkliftParking in the list of the model’s nodes.

    We’ve defined our resources, but we still need to make sure our model’s flowchart blocks will use them during the simulated processes.
  8. In the storeRawMaterial block   Properties view, do the following:
    • In the Agents move list, select by resources.
    • In the Resource pool list, select forklifts to ensure the flowchart block uses the selected resources — in our case, the forklift trucks — to move the agents.

  9. In the retrieveRawMaterial block   Properties view, do the following:
    • In the Agents move list, select by resources.
    • In the Resource pool list, select forklifts.
    • In the Transporters and resources section, in the Return home area, select if no other tasks to ensure the forklift trucks return to their home location after they complete their tasks.
    If our model’s resources move an agent,   Store (or   Retrieve) block seizes them, brings to the agent location, attaches to the agent, moves the agent to the cell, and then releases the resources.
  10. Run the model.

    You’ll see the forklift trucks pick up the pallets and store them in the storage. After a brief delay, they move the pallets to the forklift truck parking area where the pallets will disappear.
Demo model: Job Shop - Phase 2 Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).
How can we improve this article?