Skip to content

ships.Function.powerBudget

github-actions[bot] edited this page Aug 26, 2026 · 73 revisions

@elite-dangerous-almanac/core / ships / powerBudget

Function: powerBudget()

powerBudget(available, consumers): PowerBudget

Defined in: src/ships/power.ts:182

Work out a build's power budget: what the plant makes, what the modules draw retracted and deployed, and which priority groups survive.

Parameters

available

number

Power the plant generates, in megawatts (0 when no plant is fitted — every group then reads as unpowered). Must be finite and non-negative.

consumers

readonly PowerConsumer[]

Power consumers to include. Modules with enabled: false are skipped from totals; the rest fall into their priority group. BuildMetrics.powerBudget omits passive and zero-draw fittings.

Returns

PowerBudget

The PowerBudget.

Throws

If available or any consumer's draw is not a finite non-negative number.

Remarks

A group that draws exactly the power available stays online, matching the game — only going over shuts anything down.

Example

import { powerBudget } from '@elite-dangerous-almanac/core/ships/power';

const budget = powerBudget(4.8, [
  { draw: 3.0, priority: 1 },
  { draw: 2.0, priority: 4 },  // over budget: this group goes dark
]);
budget.withinBudget;               // -> false
budget.bands[3]?.poweredDeployed;  // -> false
budget.bands[0]?.poweredDeployed;  // -> true (priority 1 keeps its power)

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally