energia.components.temporal.periods#

Time Periods

Functions

compare(tree, of)

How many periods make this period

is_(a, b, /)

Same as a is b.

Classes

Idx

alias of I

Lag([of, periods])

A number of temporal Periods.

Periods([size, of, n, label, citations])

A discretization of Time.

Value([value, periods])

Input Value

cached_property(func)

Exceptions

NotFoundError

Raised when two periods are not linked in the period tree.

class Periods(size: int | float = 1, of: Self | None = None, n: int | None = None, label: str = '', citations: str = '')[source]#

Bases: _X

A discretization of Time.

Parameters:
  • periods (int | float) – Number of periods in Periods. Defaults to 1.

  • of (Periods | Lag, optional) – The periods of which this is a multiple. Defaults to None.

  • name (str, optional) – Name of the periods. Defaults to None.

  • label (str, optional) – Label of the periods. Defaults to None.

Variables:
  • model (Model) – Model to which the Periods belongs.

  • time (Time) – Time to which the Periods belongs.

  • horizon (Periods) – Horizon of the Time.

  • I (I) – Index set of the Periods.

  • constraints (list[str]) – List of constraints associated with the Periods. Defaults to [].

  • domains (list[Domain]) – List of domains associated with the Periods. Defaults to [].

  • aspects (dict[Aspect, list[Domain]]) – Aspects associated with the Periods.

isroot()[source]#

Is used to define another period?

ishorizon() bool[source]#

Is this the horizon of the model?

property tree: dict[Self, dict]#

Tree representation of the Periods

property cons: list[C]#

Constraints

property horizon: Self#

Time Horizon

property time: Time[source]#

Time to which the Periods belongs

property I: I[source]#

Index tuple

property i: I[source]#

Only Index

property true_size: float#

True size of the Periods

howmany(of: Periods)[source]#

How many periods make this period

property program: Prg#

Mathematical program

show(descriptive=False, category: str = '')#

Pretty print the component