anylogicresource-utilization

Reporting Utilization of Individual ResourcePool units


In Anylogic, How can I get statistics such as utilization of individual resource pool units? As the resourcePool.utilization() function returns the mean utilization for all units in the resource pool. Is it possible to access the data of each resource pool unit? Any ideas? Thanks in advance!


Solution

  • Updated Answer

    There is an easier way to get the utilization for individual resource units:

    1. Define a custom resource agent type, as explained here
    2. Set this new custom type for your resource pool as New resource unit
    3. Add an empty population of this custom resource type (here named myResources)
    4. In the resource pool under Advanced/Population set this empty population

    Now you can access the individual resource pool units' utilization, with x as the index of the unit:

    myResources(x).getUtilization()
    

    In order to keep track of more complex statistics, you might still need to use the more complicated solution of the original answer.


    Original Answer:

    You can build something yourself:

    1. Use the On seize and On release code in the ressourcePool to notify your custom ressource Agent that it is active/not active. You can pass a message to the agent or call a function inside the agent.

    2. The ressource agent can save its current state in a variable, statechart or similar.

    3. You can then use the standard statistic module from the Analysis palette to aggregate the information, for example to get the individual agent's utilization.