Search code examples
anylogic

How to vary the interarrival rates based on agent type in anylogic?


I am working on a model, where I want to vary the interarrival rates of agents based on parameter Type.

I have a parameter Type of Option List containing type2 and type7.

I tried to change the arrival rates with agent.Type == type2 ? (triangular(1,2,3)) : 50 but this is not working.

enter image description here


Solution

  • First, a source can only contain one unique arrival rate, you can change the arrival rate during the simulation run with the function set_rate(), but you cannot have multiple arrival rates in a single source.

    In order to have multiple rates, you will be forced to have multiple sources... you can use population of sources, but it's conceptually not different.

    Another option is to have multiple events with multiple rates and use 1 enter block to generate your agents, in each event you will need to do

    MyAgent m=add_myAgents(type);
    enter.take(m);