Search code examples
anylogicagent

Anylogic insert agent with variable values


One can create a new agent with the source.inject(1) function. Can I give this agent, while creating it, a variable value e.g. a destination?


Solution

  • I have decided to work with Benjamin's suggestion (thank you!) and used a variable as a counter and a collection for the destinations. With the counter (starting at 0, as collections start with index 0) I can match the correct new agent with its corresponding destination.