if (amountToPush <= 0){ Arrays.fill(pDefinition.getActualFlowRates(), 0f); return 0f; }
    public static float pushFractionalResourceToStores(            StoreFlowRateControllable pDefinition, float amountToPush,            float fraction) {        if (pDefinition.getStores() == null)            return 0f;        float resourceRemaining = amountToPush;        for (int i = 0; (i < pDefinition.getStores().length)                && (resourceRemaining > 0); i++) {            float resourceToDistributeFirst = Math.min(resourceRemaining,                    pDefinition.getMaxFlowRate(i) * fraction);            float resourceToDistributeFinal = Math.min(                    resourceToDistributeFirst, pDefinition                            .getDesiredFlowRate(i)                            * fraction);            float given = pDefinition.getStores()[i]                    .add(resourceToDistributeFinal);            pDefinition.getActualFlowRates()[i] += given;            resourceRemaining -= given;        }        return (amountToPush - resourceRemaining);    }