Search code examples
simulationanylogicagent

Is there a way to stop the "Source" block from generating agents after a specific time in AnyLogic?


Utilizing a source generating agents on an Interarrival time basis, I would like to stop the source block from generating agents after a certain amount of time passing so that the model can continue to process the agents.


Solution

  • One option to encapsulate all the logic inside the source block, without external events or variables, would be to select Multiple agents per arrival as true and then have a conditional statement for the number of agents, for example time() > 10 ? 0 : 1, so that after 10 model time units there will no agents arriving

    enter image description here