I am trying to create a simulation program for the multi-depot Vehicle routing problem with a heterogeneous fleet. When I create the agents (vehicle, depot and consumer), I connect them to a data base. Upon the creation of the depot and consumer agents, the database values (lattitude and longitude) are connected to the GIS map via GIS latitude and GIS longitude. The agents are then non-empty using the data from Excel. However, when I try to create a collection to iteratively use the individual agents, the collection remains empty.
Collection from anylogic as designed now
Does anybody know why the collections are empty? How can I solve this?
The collection you created is just saying that it is expecting objects of type Consumer. So it is just creating the list not adding anything
One option is to add some code to your agent's On Startup code to add it to the collection upon creation
Remember that the population object can act as a list, it is iterable and you can access objects by index... so no real need for a separate list.