Wilmark
Wilmark

Reputation: 39

Accessing Anylogic Agents not created automatically at the start of the model

With Anylogic Agent based modelling, If you create Population of Agents (for Example MyAgent and myAgents are the type and population respectively) but leave it empty at design time and when the model runs initially, say they are created by use of the inject function. When the model creates them by inject through the logic of the model, the population - myAgents still remain empty. Where is the population of these agents? I know they exist because i can count them and access their properties. How to access a particular member of this group and browse through their properties of each, like you can with existing non empty populations?

Upvotes: 0

Views: 283

Answers (1)

Wilmark
Wilmark

Reputation: 39

Ok, i just realized how to do this. When you add agents by say injecting them and you have "add agents to Default Population" (the default option). It doesnt go to the population "myAgents". I am not sure where it goes (in what population) but if you want it to go to "myAgents" you have to choose "Add agents to:" Custom Population and choose myAgents.

Upvotes: 1

Related Questions