StateOfChargeCurve

constructor(maxCharge: Energy)

Creates a linear StateOfChargeCurve with a specified maximum charge. This constructor creates a simple linear curve with two points: (0 energy, 0%) and (maxCharge, 100%).

Parameters

maxCharge

The maximum energy capacity of the battery.


constructor(curve: List<Pair<Energy, Float>>)

Creates a StateOfChargeCurve with a custom curve.

Parameters

curve

A list of Pair objects, where each pair represents a point

  • on the SOC curve. The first element of the pair is the energy level (Energy),

  • and the second element is the corresponding battery percentage (Float).

  • The list must contain at least two elements and be sorted in ascending order

  • by both energy and percentage.