charge

suspend fun KSLProcessBuilder.charge(vehicle: FleetVehicle, suspensionName: String? = null)(source)

Holds a vehicle on a charger until its battery is full, and waits.

The vehicle must already be at a charger -- this does not move it, because moving a vehicle that cannot drive is tow and moving one that can is the dispatcher's business. What it does is the part that is not movement: work out how long a full charge takes from where the battery actually is, wait that long, and put the charge back.

The duration is net of the hotel load, which keeps drawing while the vehicle sits on the charger. A ksl.modeling.fleet.Battery refuses a charging rate that does not outpace its own idle draw, so the answer is always positive and finite.

Harmless on a vehicle with no battery: there is nothing to charge and no time passes.

Parameters

vehicle

the vehicle on the charger

suspensionName

a name for the wait, for tracing