Skip to content

Implement energy and power classes to allow appropriate units to be used everywhere, separate batteries from magazines #32067

Open
@ymber

Description

Is your feature request related to a problem? Please describe.
Working with integer kJ values for power draw under 1kW requires using RNG to decide if a charge will be consumed in a given turn, which becomes more inconsistent the lower the power draw is. See #30656.

See also the original PR #31079 which is being split up as it was going to get far too big.

Describe the solution you'd like
Energy and power should have supporting code for quantity classes that allow much higher precision.

Describe alternatives you've considered
Making battery charges millijoules would be the easiest solution but then we'd have to use that precision everywhere and some cases are more appropriately handled with larger units. Separating batteries from magazines will also allow easier modification in the future if there is interest in making batteries more detailed eg modeling maximum voltage and current.

Metadata

Assignees

No one assigned

    Labels

    (P5 - Long-term)Long-term WIP, may stay on the list for a while.Items: Battery / UPSElectric power management

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions