Search code examples
anylogic

How to get the average value from 3 resource pool in anylogic?


I am working on a model, where i need to show the average of 3 resource pools in a timechart. See the image below. I tried to sum them up and divide them by 3, but the result is crossing 100%. If OlympicZBar is 59%, OlympicWomensBar is 38%, and ZBarMachine is 79%. Then the average should be 59%

((OlympicZbar.utilization()+OlympicWomensBar.utilization()+ZBarMachine.utilization())*100)/3

enter image description here


Solution

  • Don't "trust" the blue little indicators. They are not necessarily showing what utilization() returns.

    As per the help utilization() function

    Returns utilization of this resource pool. The returned value is the mean over all individual unit utilization, calculated from the most recent resetStats() call up to current time. If the number and availability of resource units is defined by a schedule, utilization will be calculated only for the operating hours of the corresponding resource unit.

    So you can see this is already more intricate and makes assumptions. Utilization is not a simple concept :)

    So either you use what utilization() gives you or you compute exactly what you actually need.