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.
- 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.
- Name the block forklifts.
- In the forklifts block Properties view, click create a custom type. This way we create a new type of a resource.
-
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.
-
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. -
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.
-
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.
-
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.
- 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.
The ForkliftTruck agent type diagram will open and display the animation shape you selected in the wizard.
-
How can we improve this article?
-