commonpower.extensions.cost_allocation.POIKCostAllocator

class POIKCostAllocator(simulation_result: ShapleySimulationResult)[source]

Bases: CostAllocator

Pareto optimal imperfect knowledge cost allocation, based on the paper [1].

[1] M. Eichelbeck and M. Althoff, “Fair Cost Allocation in Energy Communities under Forecast Uncertainty,”

in IEEE Open Access Journal of Power and Energy, 2024, doi: 10.1109/OAJPE.2024.3520418.

Cost allocator.

Parameters:

simulation_result (ShapleySimulationResult) – Simulation result from ShapleySimulator.

Methods

allocate

Allocate costs based on the Pareto optimal imperfect knowledge method.

sweep

Sweep over a list of norm orders and weight coefficients to obtain multiple cost allocations.

_solve_1_norm() tuple[tuple[List[float], List[float], List[float]], tuple[float, float]][source]

Compute the Pareto optimal cost allocation for the 1-norm. Here, the norm of gamma is constant (1) and can therefore be omitted in the objective function. By definition this represents the worst-case minimum deviation and best-case minimum regret. This is a linear program.

Returns:

tuple[tuple[List[float], List[float], List[float]], tuple[float, float]]

Allocation result, consisting of

(payments, coi shares, regrets), (normalized_gamma, normalized_z)

_solve_inf_norm(mu: float, gammas_1_norm: List[float], regrets_1_norm: List[float]) tuple[tuple[List[float], List[float], List[float]], tuple[float, float]][source]

Compute the Pareto optimal cost allocation for the infinity norm. This is a linear program.

Parameters:
  • mu (float) – Objective function weight.

  • gammas_1_norm (List[float]) – Worst-case gamma values.

  • regrets_1_norm (List[float]) – Best-case regret values.

Returns:

tuple[tuple[List[float], List[float], List[float]], tuple[float, float]]

Allocation result, consisting of

(payments, coi shares, regrets), (normalized_gamma, normalized_z)

_solve_p_norm(mu: float, p: int, gammas_1_norm: List[float], regrets_1_norm: List[float]) tuple[tuple[List[float], List[float], List[float]], tuple[float, float]][source]

Compute the Pareto optimal cost allocation for some p-norm. This is a qudratic program for p=2.

Parameters:
  • mu (float) – Objective function weight.

  • p (int) – Norm-order of the objective function representing minimum deviation.

  • gammas_1_norm (List[float]) – Worst-case gamma values.

  • regrets_1_norm (List[float]) – Best-case regret values.

Returns:

tuple[tuple[List[float], List[float], List[float]], tuple[float, float]]

Allocation result, consisting of

(payments, coi shares, regrets), (normalized_gamma, normalized_z)

allocate(p: int = 2, mu: float = 1.0) list[float][source]

Allocate costs based on the Pareto optimal imperfect knowledge method.

Parameters:
  • p (int, optional) – Norm-order of the objective function representing minimum deviation. The value -1 represents the infinity norm. Defaults to 2.

  • mu (float, optional) – Objective function weight. Defaults to 1.0.

Returns:

list[float] – Cost allocation.

sweep(p: int | List[int], mu: float | List[float]) tuple[dict[str, tuple[list[float]]], list[tuple[float, float]]][source]

Sweep over a list of norm orders and weight coefficients to obtain multiple cost allocations. This can be used to obtain a Pareto front.

Parameters:
  • p (Union[int, List[int]]) – Norm-order of the objective function representing minimum deviation. The value -1 represents the infinity norm.

  • mu (Union[float, List[float]]) – Objective function weight.

Returns:

tuple[dict[str, tuple[list[float]]], list[tuple[float, float]]]

The first tuple contains

(allocated payments, coi shares, regrets) for each combination of p and mu. The second tuple contains the normalized objective function values for each Pareto point.