Planning with a battery

A strategic layer plans the whole trip ahead of time, deciding where to detour and where to recharge. A reactive layer drives the plan step by step and calls the strategic layer again when the world changes. Paint terrain to see both layers work.

default path
battery-aware path
⚡ charger
S start, G goal; hills cost extra energy

Pick a brush, then click or drag on the map. Edits made while the robot is moving force it to replan from where it is, with the battery it has left.

Edit the map

Choose a planner

Battery

More settings
Compare the numbers

What the layers are saying

    How the strategic layer works
    Dijkstra search over states (x, y, battery). A move to a cell costs 1 + λ·energy and lowers the battery by that cell’s energy. A move that would take the battery below zero does not exist. Standing on a charger adds a move to a full battery, costing time in proportion to the energy refilled. The shortest-path plan ignores all of this, so it can strand the robot.