The Problem
Engagement
Architecture
Three independent engines: a consumption model using multiplicative correction factors, an eleven-component TCO calculator, and a route feasibility solver that treats stop planning as constraint satisfaction. Each engine is a Python module with its own test suite. The UI consumes them, never the other way around. Configuration Layer
Every default lives in defaults.json. Drivetrain specs, WTW efficiencies, fuel prices, residual value matrices, charging infrastructure costs - all of it. The UI exposes overrides for every value. When the underlying numbers move, the file moves; the code does not. UI Layer
A four-page Streamlit app. Dashboard with a radar chart across all seven drivetrains. Consumption and range with adjustable conditions. TCO calculator with a multi-year cost breakdown. Route feasibility with a map and stop planning across European routes. Data
JSON-driven from end to end. Drivetrain configurations, route definitions, refueling and charging station catalogs - all under version control, all human-editable.
Notable Engineering Decisions
Adjusted consumption is base times topography times load times temperature times the cwA and rolling-resistance ratios. Each factor is independent and tunable. First-order approximation is enough for relative comparison between drivetrains; chasing VECTO-grade absolute accuracy was scope I refused. Composable cost components for TCO.
Eleven independent line items - vehicle, financing, energy, maintenance, tires, tolls, taxes, insurance, depreciation, battery replacement, charging infrastructure - each computed in isolation and summed. Sliders mutate inputs and the breakdown re-renders in real time. Stop planning as constraint satisfaction.
Route feasibility does not simulate a driver. It asks whether, given range, available stations, and the route polyline, a valid sequence of stops exists. The answer is a recursive search that fails fast on infeasible drivetrain-route pairs. Battery degradation modeled within the validated envelope.
Field-validated state-of-health data exists up to 120,000 km per year. The tool refuses to extrapolate beyond what has been measured; higher mileages are documented in text but not surfaced in calculations. Honest beats impressive. Three policy scenarios for post-2031 toll exemptions.
Zero-emission vehicles are toll-exempt in Germany until June 30, 2031. What happens after is unknown. The tool models three futures - full rate, 75% discount, exemption extended - as a user-toggleable input rather than a hardcoded assumption. Bilingual UI through a single label registry.
Roughly 200 strings keyed by language; the toggle swaps the active map. Switching language triggers a Streamlit rerun, which resets widget state. Documented in the user guide rather than over-engineered around.
Challenges Solved
Every feature request had a "do we need this for the decision?" gate. Real-time fuel-price APIs, machine-learned consumption models, multi-currency support - all proposed, all deferred. The tool ships because what is in it earns its keep. Working within client confidentiality
Cost defaults are informed by client-supplied industry data that cannot be exposed. The toll module, by contrast, references only public legislation: BFStrMG amendments, EU Directive 2022/362, published Toll Collect rates. Public modules stay independently citable; confidential inputs stay sealed. Reproducibility
Every analysis exports to CSV with the full input set. A stakeholder can replay a calculation a year from now with the exact assumptions that produced it. No "I think we used these numbers" emails.
Impact
Eleven cost components in the TCO breakdown.
Three calculation engines with independent test suites.
115 tests passing across consumption, TCO, and route feasibility.
~6,800 lines of Python, German and English UI, four European routes mapped.
Ahead of schedule on every milestone; user-facing improvements suggested and shipped within the engagement window.