# Approaches and live observations

Open **5 Approaches & live**. This workspace uses the same event-based charging engine as the comparison and queue-manager workspaces, with supplied approaching trucks included together in the forecast. It can run before a comparison is computed.

## Simulated approaches

Load the simulated journey demo, then compute or advance simulation time. Each truck has a road distance at its observation minute, assumed speed (or a supplied route duration), usable battery capacity and current SOC. SOC is a fraction: 0.30 means 30%. Driving energy is distance × consumption × contingency multiplier, plus auxiliary power × travel hours. The model updates route progress, battery, arrival time, queue waiting and charging state. It cannot move an energy-depleted truck to the hub.

Edit the JSON or import truck CSV. CSV replaces approaching trucks, retaining the displayed hubs. Every truck must reference a hub_id in those snapshots. Download the CSV template from the interface. Simulation timestamps use observation_min and the displayed assessment minute. Different hub snapshots must represent distinct trucks; a truck cannot be in both an approach and a waiting/charging snapshot.

Use **Use first-hub arrivals in comparison** to populate the existing truck-CSV workflow. This sends only physically reachable approaching trucks assigned to the first listed hub, still requiring charge. It does not transfer other hubs, existing snapshot jobs or automatically run the comparison. Review the study horizon and scenario settings before running it. Approach time is independent of the comparison playback clock.

## Live imports and connector

There is no GPS service configured. Live mode accepts externally supplied observations; the included mock live demo is explicitly labelled fictional. Import JSON containing hubs and trucks, or CSV truck observations. Both trucks and hubs require ISO observed_at timestamps with a timezone, such as 2026-10-26T10:00:00Z. Assessment uses the browser's current clock. Keep that clock accurate.

For automatic updates, a team-owned adapter must expose an HTTPS endpoint returning the same JSON envelope. Download the feed example to see its structure. The endpoint must permit browser CORS access from the published site origin. The connector fetches without cookies every 15 seconds while the tab is visible; a failed request disconnects it and removes the previous forecast. Refresh occurs only while the page is open. URL credentials, query strings and redirects are rejected. No secrets are saved or embedded in the public site. Put provider authentication on your own adapter server; select only observations suitable for the feed's access policy.

Each truck needs truck_id, hub_id, observed_at, distance_km, battery_kwh, soc_current, soc_target and max_charge_kw. Use speed_kph for an assumed ETA, or route_travel_min from an actual routing provider for a route-duration estimate. consumption_kwh_per_km defaults to 1.3, energy_factor to 1.2 and reserve_soc to 0.1: illustrative assumptions, not vehicle calibration. A stopped truck without a supplied route duration has unknown ETA. Latitude/longitude alone are insufficient: the adapter must calculate road distances/durations to hubs using verified HGV-suitable routes. No road routing, GPS subscription or live charger availability is provided by this website.

Hub snapshots need hub_id, observed_at, open/compatible booleans, chargers, charger_kw, site_kw, optional efficiency, queue_policy, active/waiting job lists and holding jobs. Active/waiting jobs use the existing engine fields (truck_id, battery_kwh, soc_arrival, soc_target, max_charge_kw). soc_arrival here means SOC measured at snapshot time. Connected jobs remain non-preemptive. Waiting jobs may include waiting_age_min. Holding jobs use truck_id and remaining_bay_min.

Optional alternative_routes on each truck contain hub_id, distance_km, travel_min and their own observation timestamp. They must be road routes from the truck position used for the assessment; routes older than the maximum age are rejected. Each alternate-hub trial includes that hub's supplied workload and known approaching trucks. Trials are independent, and cannot all be interpreted as simultaneous diversions.

## Interpretation

- Stale or future vehicle observations cannot produce ETA/queue forecasts; stale, future, closed or incompatible hub snapshots cannot produce wait forecasts.
- An elapsed live ETA does not confirm physical arrival. Move that truck into a new hub snapshot, rather than listing it twice.
- Constant route progress extrapolation is an estimate between observations. Live queue states are forecasts, not measured bay occupancy.
- All supplied approaching trucks compete by the selected hub policy at arrival. Approaching trucks do not reserve bays or interrupt charging sessions.
- Below-reserve trucks that are physically reachable still enter their assigned queue, with a warning. Alternative hubs require the configured reserve.
- Forecasts are bounded to seven days. Sessions outside that bound have unknown start/completion times.
- No future unknown arrivals, real traffic inference, charging taper, driver-hours enforcement, automatic routing/diversion, charger booking or battery drain while waiting is modelled.
- Observations/results remain in the browser unless downloaded. The connector makes direct requests only to the URL entered by the visitor; disconnect when finished.

Validation covers analytical travel/energy/charging, time progression, competing arrivals and priorities, stale/future timestamps, elapsed live ETAs, energy failure, route durations, alternative reachability and held bays. Software verification is not calibration against field operations.
