Search code examples
anylogic

I want to the female mosquito to spawn eggs three times in its life cycle with different nu each time i.e 200,150,100 at day 17,20,23


I am trying to model the mosquito lifecycle and got stuck in the part where female mosquitoes have to lay eggs with different numbers each time. say at the age of 17, 20, and 23 with 200–250, 150–200, and 100–150. The maximum number of eggs for each mosquito throughout its life cycle is 500.

I used state chart and in the reproduce state, I put this code ** for (int i=0; i<200; ++i){ main.add_mosquitoes(); };**

it is adding agents and later I am getting the error after some time "the model has reached the maximum number of dynamically created agents." I am using the PLE version. Help please


Solution

  • The free PLE version limits the total number of agents you can have.

    You can either:

    1. refactor the model to have fewer agents (for example assume 1 Mosquito agent actually represents 100 real mosquitos)
    2. kills agents asap: do not keep your Mosquito agents around forever. If they die, also kill (i.e. remove) the agents from the model

    Or upgrade, of course :)