I can't seem to find a way to keep a resource seized after "rackPick". In the "rackPick" block I am choosing "Use resources to move". So I want a resource to move the agent from the pallet rack to a certain node. When reaching the node, I want the same resource to stay there to work on other activities (e.g. pick-up block). However, there is no option not to release the resource after picking. I also don't want to use a seize block before rack pick because I want the agent to move at the speed of the resource during picking. Any suggestions?
Thanks.
Additional details: The exact process is as follows:
Rack Pick --> Pick-up --> Rack Store
I need the same resource to do the three steps.
what you have to do is reserve the resource. You can have a link to agents in the resource called agentLink... it will be connected if reserved and disconnected if not reserved.
in the resourcePool on seize unit action you can connect agent and resource through the agentLink (unit.agentLink.connectTo(agent)
)
You do also in the rackpick block custom choosing of a resource based on the condition !unit.agentLink.isConnected()
then in the rackstore you use the condition of the resource as unit.agent.equals(agent.resourceLink.getConnectedAgent())
And that's it :)
That sounds great, the only problem is I cannot find Java Action fields that allow the use of "unit" - I checked using the light bulb. Alternatively, I used the following: ((ResourceName)agent.resourceUnits().get(0)).agent = agent; Does that make sense? (Assuming only 1 resource is seized) - I wrote that "On resource arrived"
in the resourcePool you have the onSeize action... do it there
i changed the answer a bit... I didn't test it myself, but that's the idea at least...
Excellent, always on point. Before you edited your answer by the way I was thinking of using the agentLink. It's quite useful and more efficient than creating agent variables. Thanks again for your usual and great answers.