Search code examples
anylogic

In Anylogic, is it possible to send an agent from one storage to another directly?


I have 2 storages (called storageA & storageB) and I want to move an agent (pallet) from one to the other via forklifts. I have set up the following.

enter image description here

A pallet is created at a node and is moved to storageA via 'store'. This part works fine. The pallet is then moved to storageB via 'store1' after a delay. This is when the following error occurs:

Exception during discrete event execution:
root.store1.seizeTrans.freeSpaceSendTo:
Path not found! {agent=2, source={level=level, pos=(1673.3333333333333, 3245.0, 0.0)}, target={level=level, pos=(1857.25, 3160.4845, 0.0)}}

It works if I replace 'store1' with a retrieve block and send it to a node first. However I would like to send the pallet directly to another storage rather than via another location. Is this possible?

Please let me know if I have not provided enough information.

Thanks


Solution

  • yeah unfortunately you can't do that as far as I know, the solution I use is the following, which is actually not a super robust solution... but has been ok in applications so far

    1. Place a retrieve block between your delay and your store1
    2. Use the agent you pick up as destination: agent destination
    3. on the on seize action of the retrieve block do:agent.transporter=unit;

    4.On the store1 block put the highest priority for the task
    5. ON the store1 block use resource custom transporter choice: agent.transporter.equals(unit)
    6. The dispatching policy should be nearest to the agent in store1, but doing all the above ensures that the resource continues doing the task no matter what... by only using the dispatch policy your model will work 99.999999% of the time... the problem occurs only if another task with higher priority occurs at the exact same time as the transporter is released in the retrieve block, which is rare, but can happen.