Yope
Yope

Reputation: 87

How to store agents and its' parameters in a 2 dimensional collection in anylogic?

I have a population of agents (called products) that has multiple parameters of different types. The parameters are "amount" of type int and the other is "location" which is a location on the GIS map. Now I would like to store these agents in a collection when they enter an enter block. Does anyone know how to do this? What type of collection could I use and how do I define the elements?

Upvotes: 0

Views: 416

Answers (1)

Benjamin
Benjamin

Reputation: 12795

Drag in a collection, keep the default ArrayList type and set the content type to your agent type.

In the Enter block's "on enter", write myCollection.add(agent)

That is all :)

Upvotes: 0

Related Questions