The Charger Queue Problem
Before Stima's charge routing, fleet managers told drivers to charge "when you get to 20% and you're near a station." The natural result of this simple rule is that all drivers with 20% battery who are operating in the same general area converge on the same charging station at roughly the same time. Queue forms. Drivers wait. Idle time accumulates.
In Samuel's Kasarani cooperative, the main charging shed had four AC chargers. Each charge cycle took 90 minutes for a full recharge from 20%. With 40 vehicles spread across three shifts, the morning shift transition — when night shift bikes came in and day shift bikes needed to go out — created a queue that sometimes stretched to 6 vehicles waiting for a charger. At 45 minutes average wait time during peak hours, the morning queue was costing the cooperative roughly 270 vehicle-minutes of productive time per day.
The queue problem was compounded by the fact that not every vehicle needed a full charge. A bike returning after a two-hour shift with 45% remaining didn't need 90 minutes on the charger — it needed 25 minutes to reach a comfortable reserve for the next driver's shift. But without data about each bike's current state, the cooperative used a flat rule: everything charges until the indicator shows 100%, regardless of where it started.
What the Dispatch Plan Actually Computes
The Stima charge routing plan is generated every morning at 5:30am and updated every 30 minutes during shift transitions. It takes five inputs: current SOC for each vehicle (from overnight telemetry sync), pack health score for each vehicle (from the degradation model), scheduled shift assignments (imported from the cooperative's dispatch sheet), charger availability at each station (location, port count, current occupancy), and historical charge duration for each pack (how long it actually takes to reach target SOC, which varies by pack age and health).
The algorithm assigns each vehicle a charge window — a specific station and a time range within which to arrive — with the goal of distributing charger demand evenly across the available stations and across the available charging time. Vehicles with lower health scores are given priority charging slots and directed to chargers with stable power delivery (vs. generator-powered stations when that option exists).
The key insight is that the routing problem is not just spatial (which station is nearest) — it's temporal. Two vehicles that arrive at the same station 45 minutes apart don't compete for charger ports. The algorithm's objective function minimizes total idle time across the fleet, not just minimizes individual vehicle travel distance to a charger.
We modeled this as a modified vehicle routing problem with time windows (VRPTW), which is classically NP-hard for large instances. For fleet sizes under 200 vehicles, a greedy heuristic with local search improvements runs in under 4 seconds on the backend and produces solutions within 3–5% of optimal for the shift scheduling patterns we've observed. At 200+ vehicles, we switch to a Google OR-Tools constraint programming solver, which finds near-optimal solutions in under 60 seconds.
The 23-Minute Reduction: Where It Comes From
The 23-minute average wait time reduction we observed across the three cooperatives in our pilot breaks down into three contributing factors:
Queue distribution: approximately 12 minutes of the reduction comes from spreading charger demand across stations and time windows rather than allowing natural convergence. When drivers follow the routing plan's suggested arrival window, peak charger occupancy drops from 94% during uncoordinated charging to 67% during coordinated charging. The 27-percentage-point occupancy reduction directly reduces expected wait time.
SOC-aware charge targets: approximately 7 minutes of the reduction comes from charging each vehicle to a calculated target SOC rather than always to 100%. A vehicle that starts its next shift with 90% SOC instead of 100% loses approximately 8 km of range — which is acceptable for most Nairobi boda-boda routes — and saves 12–15 minutes of charger occupancy. Spreading this efficiency across the fleet frees charger ports faster, reducing queue depth for vehicles that genuinely need full charges.
Pack health-aware routing: approximately 4 minutes of the reduction comes from routing degraded packs to slower, more stable chargers and healthy packs to faster chargers. This prevents the pattern where a degraded pack occupies a fast charger for longer than expected (because its actual charge acceptance rate is lower than a healthy pack), creating unexpected queue extension. Predictable charge durations enable more accurate time window planning.
Adoption: Getting Drivers to Follow the Plan
The routing plan is only useful if drivers follow it. We assumed this would be easy — who wants to wait in a queue? It turned out to be harder than expected. Drivers developed habits over months of operation: specific charging stations they preferred, specific times they habitually charged, routes they always took. A routing plan that changed those habits required behavior change, which required trust.
The first two weeks of routing plan deployment in Samuel's cooperative had a compliance rate of approximately 55%. Drivers went to their preferred stations at their preferred times, ignoring the suggested windows. Queue times actually got slightly worse because the plan had been optimized assuming compliance that didn't materialize.
The adoption inflection came when Samuel posted the before/after queue times on the charging shed wall. Concrete numbers — "average wait time this week: 14 minutes vs. 37 minutes before the plan" — changed driver perception. Two weeks after Samuel posted the numbers, compliance was at 78% and still climbing. By month two, compliance was 91%, and drivers who violated the plan and encountered a queue were noticeably frustrated rather than resigned.
The lesson for fleet technology adoption: data transparency creates alignment faster than instructions. Telling drivers to follow the plan didn't work. Showing them the queue-time data and letting them connect the behavior to the outcome worked. Stima's dashboard now has a built-in "performance board" view that cooperative managers can display in the charging shed on a cheap Android tablet, specifically because Samuel's experience showed that visible results drive adoption more than app notifications.
Current Limitations and Roadmap
The routing plan currently assumes that charger availability data is accurate. In practice, chargers fail — power outages, equipment faults, vandalism. When a charger goes offline unexpectedly, the plan assigns vehicles to a station that's no longer functional, and drivers arriving there create an improvised queue at the next nearest station. We're working on real-time charger status monitoring via a separate IoT module at the station level, which would allow the routing plan to update dynamically when a charger goes offline.
The second current limitation is that the plan doesn't model demand uncertainty well. If three drivers finish their shifts early because of rain (common in Nairobi's rainy seasons — boda-boda demand drops sharply when it rains), the plan's assumptions about when vehicles return to the shed are off. We're integrating weather data and historical demand patterns to build probabilistic shift completion time estimates, which will make the plan more robust to weather-driven schedule changes.
Filed under: Product, Fleet Operations · Back to Blog