Search code examples
anylogic

Access to agents that grouped using Batch block


By Batch block I group together a certain amount of agents, They get a new agent identity. I defined a temporary batch permanent batch = false. How I can access to the agents that are 'inside' the new agent?

I tried to search in which population he keeps the original agents, without success.


Solution

  • you can access through agent.contents()

    Beware though, that you need to use unbatch if you want to use those agents for anything at all... i would say it's good practice to take these batched agents as read_only otherwise unpredictable things might happen