Search code examples
anylogicagent-based-modeling

Anylogic reset resourcePool agent parameter each day


I'm modelling a call centre in AnyLogic. I have two agent types - calls, and call operators.

Each call operator has a variable that tracks the number of calls that they have answered, however I want this number to reset each day. The number of available resources changes according to a schedule, but units are preserved when capacity decreases.

Can anybody shed some light on how to go about this?

callOperator description

callsToday variable

resourcePool object

I'm currently trying to use an event that triggers at the end of every day, but I can't work out how to correctly reference each call operator individually.


Solution

    1. Drag in your CallOperator agent type next to the resource pool
    2. turn it into a population of agents that is "initially empty"
    3. Change your pool settings to "Add units to custom population": enter image description here
    4. Select the population from step 2
    5. Create a cyclic event that recurs daily
    6. in the event, loop through the population and reset what you need, for example as below:

    (dummy code):

    for (CallOperator currOp : myPopulationFromStep2) {
        currOp.counter = 0;
    }