energia.modeling.variables.control#

Control Variable

Functions

dataclass([cls, init, repr, eq, order, ...])

Add dunder methods based on the fields defined in the class.

Classes

Aspect(primary_type[, nn, ispos, neg, ...])

A particular facet of the system under consideration.

Control(primary_type[, nn, ispos, neg, ...])

Some action to be performed by a component that adjusts a state variable can have a consequence (Impact) or elicit a motion (Stream) that has a consequence (Impact)

class Control(primary_type: Type[_Component] | tuple[Type[_Component], ...], nn: bool = True, ispos: bool = True, neg: str = '', latex: str = '', bound: str = '', label: str = '', use_multiplier: bool = False)[source]#

Bases: Aspect

Some action to be performed by a component that adjusts a state variable can have a consequence (Impact) or elicit a motion (Stream) that has a consequence (Impact)

Parameters:
  • primary_types (Type[_Component] | tuple[Type[_Component], ...]) – associated components type(s). Defaults to None.

  • nn (bool) – If True, the decision is a non-negative decision. Defaults to True.

  • ispos (bool) – If True, the decision is positive (non-negative). Defaults to True.

  • neg (str) – Negative form or representation of the decision, if any. Defaults to “”.

  • latex (str) – LaTeX string. Defaults to “”.

  • bound (str) – if the aspect is bounded by another. Defaults to “”.

  • label (str) – Label for the decision. Defaults to “”.

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

  • name (str) – Name of the Aspect.

  • indices (list[Location | Linkage, Periods]) – List of indices (Location, Periods) associated with the Aspect.

  • bound_spaces (dict[Commodity | Process | Storage | Transport, list[Location | Linkage]]) – Spaces where the Aspect has been already bound.

  • domains (list[Domain]) – List of domains associated with the Aspect.

Raises:

ValueError – If primary_type is not defined.

update(domain: Domain, reporting: bool = False)[source]#

Add a domain to the decision variable

Balance(domain: Domain)#

Add a general resource balance for the aspect over the domain

property I: Idx#

gana index set (I)

Map(domain: Domain, reporting: bool = False)#

Map the aspect to the domain

property V: Var#

Variable

alias(*names: str)#

Create aliases for the decision

Parameters:

names (str) – Names of the aliases

bound: str = ''#
property box#

Box of domain indices

property cons: list[C]#

Constraints

crumple_domains()#
property dispositions: dict[Self, dict[Commodity | Process | Storage | Transport, dict[Periods | Location | Linkage, dict[Location | Periods | Linkage, bool]]]]#

Dispositions dict

gettime(*index) list[Periods]#

Finds the sparsest time scale in the domains

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property isneg: bool#

Does this remove from the domain?

ispos: bool = True#
label: str = ''#
latex: str = ''#
property maps: dict[str, dict[Domain, list[Domain]]]#

Maps of the decision

property maps_report: dict[str, dict[Domain, list[Domain]]]#

Maps of the decision

neg: str = ''#
property network: Location#

Circumscribing Location (Spatial Scale)

nn: bool = True#
output(n_sol: int = 0, aslist: bool = False, asdict: bool = False, compare: bool = False) list[float] | dict[tuple[Idx, ...], float] | None#

Solution

Parameters:
  • n_sol (int, optional) – Solution number. Defaults to 0.

  • compare (bool, optional) – Compares the solution with the previous one. Defaults to False.

  • optional) (aslist (bool,) – Returns values taken as dict. Defaults to False.

  • optional) – Returns values taken as list. Defaults to False.

Returns:

List of values taken by the decision.

Return type:

list[float] | None

property problem: Problem#

Tree

property program: Prg#

Mathematical Program

show(descriptive=False)#

Pretty print the component

property sign: float#

Gives the multiplier in balances

property sizes#

dict of domain sizes

property space: Space#

Space

property time: Time#

Time

use_multiplier: bool = False#
primary_type: Type[_Component] | tuple[Type[_Component], ...]#