In my FlexSim model, when a certain lower bound (threshold) is reached, the battery of the AGV needs to recharge until it's upper bound (e.g. if it drops below 20% it needs to charge until 90%).
At the other hand, when it has nothing to do in the buffer, when the battery level is not below the threshold, it should charge for the time it is in the buffer.
How do I model this in FlexSim?