I am working on a model that works like that: there is a agent (uld) coming and brings 10 items. these items are then moved by a transporter (forklift) to a particular zone. In that zone (in theory), they drop the item, wait a few seconds, and take it back and place it in a storage zone.
Originally, I wanted the forklift to not drop the item, just go in the node, wait a bit and go to the final location. I couldn't figure out how to make it happen without releasing the item, so I let the release happen. Now, in most case, it works fine: the forklift drops the item, wait, takes it back and stores it. But sometimes, when too many uld are coming and drop too many items, it seems like the forklift goes straight for a new one instead of storing the item first.
Is there a way, either to make it like the items aren't released, or is there a way that the same forklift always retake its item?
here is the zone where the forklifts are supposed to drop and retake the item
here is the logic I used for the movement of the forklift to the zone
Originally, i wanted the forklift to not drop the item, just go in the node, wait a bit and go to the final location. I couldn't figure out how to make it happen without releasing the item
You can do it if you have a MoveByTransporter1-Delay-MoveByTransporter2 flow, where you don't release the transporter in MoveByTransporter1 and don't seize one in MoveByTransporter2.
But since you're using a Store block afterwards, which currently cannot work with already seized transporters, I suggest using the Link to agents. This way your forklift and item can stay connected even after release and they can "find eachother" again. For this example, let's call your agent types Uld and Forklift. (You need custom agent types to be able to use Links)
((Forklift)unit).myItem.isConnected()==false
. To connect the item and forklift, put this line into On seize transporter of the same block: agent.myForklift.connectTo((Forklift)unit)
agent.myForklift.getConnectedAgent().equals(unit)
. Too free up the forklift after it finished the task, write this line into On release transporter of the Store block: ((Forklift)unit).myItem.disconnect()