'Error in seizing crane after batch operation

In Any Logic i have batched segments to rings (both are agents) if i want to move rings using move by crane it is giving error:

As i am pretty new to this software i have very less idea how the agents are seized and assigned to any block.

Can anyone please tell me how to sort this issue i tried to use restrict block OR delay before move by crane but still it did not work. Please find details here

Thank you in advance.



Solution 1:[1]

The error you're getting has to do with the space of the agents (both the crane's space and the destination agent's space).

Specifically, in order for the crane to pick up the agent and the move it, they both have to be in the same space.

To ensure that they're both in the same space, try adding code "On Exit" of the queue right before the moveByCrane block.

It should look something like this:

On exit queue:

agent.setSpace(overheadCrane.getSpace());

Solution 2:[2]

Did you define the location of the batch? If not, this might be the cause of the error.

AnyLogic creates a new agent when you use the batch flowchart block. Unless explicitly specified, this agent will not belong to any space. That's why you need to define the location of the batch first as seen here: Batch location

Another thing that I've noticed is that you entered node1 as destination of the MoveByCrane block. Based on your attached screenshot, you want the crane to move the agent from node1 to node2. In this case, you should enter node2 as destination of the MoveByCrane block instead.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryan Marizza
Solution 2 Nadia Galaske