computeRouteWithChargeStops

Computes a route asynchronously with the given routePlan and optimizes it for the given electric vehicle in EVRoutePlan.routeOptions If the route requires more battery than the current battery level of the vehicle to reach the arrival (defined in VehicleStatus in EVRouteOptions.vehicle), it will be optimized and one or many ChargePoolStop will be added in Route.waypoints. If the EV optimization failed, the unoptimized route will be returned with the detailed error in EVRouteResult.optimChargeResult.

ComputeRouteListener.onComputeError is only called if no route can be computed with the given routePlan.

All RouteOptim modes are supported, including RouteOptim.ECO.

Parameters

routePlan

that contains info for the route computation and RouteOptions

listener

callback for getting computation's progress and result

Throws

when caught ComputeRouteListener.onComputeError is called with a Error.code corresponding to the PlannerException.code and a Error.detailedMessage corresponding to the PlannerException.message


fun computeRouteWithChargeStops(routes: List<Route>, evProfile: EVProfile, status: VehicleStatus, rechargeParams: RechargeParameters, listener: ComputeRouteListener, fastComputation: Boolean = true)

Computes optimized routes asynchronously for an electric vehicle using the given routes

Parameters

routes

the routes to optimize

evProfile

the EVProfile of the electric vehicle

status

the current status of the electric vehicle that must have VehicleStatus.currentEnergyLoad defined in kWh

rechargeParams

the RechargeParameters for the optimization

listener

callback for getting computation's progress and result

Throws

when caught ComputeRouteListener.onComputeError is called with a Error.code corresponding to the PlannerException.code and a Error.detailedMessage corresponding to the PlannerException.message