I have tried to use add_people() in an event during running the Agent population and SD housing example of anylogic, in order to add more agents to the model during the simulation but I face this error. How can I solve this problem?
[Exception during discrete event execution:
-1
java.lang.ArrayIndexOutOfBoundsException: -1
at com.anylogic.engine.Dimension.getIndexPosition(Unknown Source)
at com.anylogic.engine.HyperArray.getPosOf(Unknown Source)
at com.anylogic.engine.HyperArray.get(Unknown Source)
at agent_population_and_sd_housing.Person.makeDecision(Person.java:428)
at agent_population_and_sd_housing.Person.executeActionOf(Person.java:408)
at com.anylogic.engine.EventRate.execute(Unknown Source)
at com.anylogic.engine.Engine.m(Unknown Source)
at com.anylogic.engine.Engine.jd(Unknown Source)
at com.anylogic.engine.Engine.h(Unknown Source)
at com.anylogic.engine.Engine$g.run(Unknown Source)]