It can be as simple as:
- Robot chooses to recharge at roboport; roboport +1 bots charging
- Robot is finished charging and flies away; roboport -1 bots charging
Code: Select all
Recharge time = (Flight distance to roboport) / (Robot low energy flying speed) + (Robots charging at roboport) / (Robot charging speed)
Another problem is the roboport with the shortest wait time might be in the opposite direction the robot is trying to go. So there should also be a penalty for going backwards.
Code: Select all
Flight distance = (Robot to roboport distance) + (Roboport to destination distance)
Code: Select all
Discount = MIN((Roboport to destination distance), (Max robot range on a full charge)) * ((Robot high energy flying speed) - (Robot low energy flying speed)) / (Robot high energy flying speed)
Code: Select all
Trip time = (Robot to roboport distance + Roboport to destination distance - Discount) / (Robot low energy flying speed) + (Robots charging at roboport) / (Robot charging speed)