anylogic

What is the proper way to retrieve items from the initial stock of a "storage system" in Anylogic?


I am trying to model a warehouse, which is already stocked (used the initial stock parameter in the storage system block), and I want to move items from the storage racks to shipping docks (modeled as rectangular nodes) using free-space transporters. My current model is shown below:

enter image description here

In the source block named "initiateRetrieval", I am running a for loop to extract all the items (material item agents) stored in the "storage" and pass them to the "enter" block. I am storing them again in the storage because the retrieve block does not recognize the agents as part of the storage otherwise.

What is the proper way to retrieve items from the initial stock of the "storageSystem" in Anylogic? I am relatively new and still learning. Any feedback is appreciated.


Solution

  • Use a Enter block, then a Retrieve block. Set the enter block to accept your MaterialItem agent type.

    Add a button with the code myEnterBlock.take(xxx) and make xxx and actual item in a rack. Check out the API to see how to access specific items. Or use randomFrom(myRack.getAgents()) to grab a random one

    Strongly suggest you do the tutorials and study all the example models for the MH library to understand the philosophy. Your current approach is "upside down" :)