Search code examples
javaagentanylogic

Anylogic: Access Agents on a conveyor/in a Convey block?


I have 4 items that move into a 'convey' block from the materials handling library. I want to be able to access these items to change their variables. what function do I need?

I've tried convey5.agents() and convey5.agentsInRange(1) but not had much luck. I know I've managed to do something previously with queue blocks, is this possible with convey blocks?

many thanks.


Solution

  • use convey5.get(i) where i is the index of the agent you are interested in. See Javadoc below:

    enter image description here