energia.components.spatial#

energia.spatial init file

Classes

Linkage(source, sink[, dist, bi, auto, ...])

Linkage between two Locations.

Location(*has[, label, citations])

A discretization of Space.

class Linkage(source: Location, sink: Location, dist: float | None = None, bi: bool = False, auto: bool = False, label: str = '', citations: str = '')[source]#

Bases: _X

Linkage between two Locations.

Parameters:
  • name (str, optional) – Name of the Linkage. Defaults to None.

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

  • source (Loc) – Source Location.

  • sink (Loc) – Sink Location.

  • dist (float | Unit) – Distance between the two Locations.

  • bi (bool, optional) – Is the Linkage bidirectional? Defaults to False.

  • auto (bool, optional) – Is the Linkage automatically generated? Defaults to False.

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

  • space (Space) – Space to which the Linkage belongs.

  • network (Loc) – Network to which the Linkage belongs.

property space: Space[source]#

Space to which the Location belongs

property network: Location#

Network to which the Location belongs

property isnetwork: bool#

Is this the network of the model? Linkage can never be the network

property isin: Location | None#

Location to which the Linkage belongs

rev()[source]#

Reversed Link

property I: I[source]#

gana index set (I)

update_hierarchy(hierarchy: int = 0)[source]#

Updates the hierarchy of the locations

property cons: list[C]#

Constraints

property program: Prg#

Mathematical program

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

Pretty print the component

class Location(*has: Self, label: str = '', citations: str = '')[source]#

Bases: _X

A discretization of Space. A location can be inclusive of other locations

Parameters:
  • has (tuple[IsLocation]) – Locations contained in this Location.

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

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

  • name (str) – Name of the Location. Set when the Location is assigned as a Model attribute.

  • constraints (list[str]) – List of constraints associated with the Location.

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

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

  • isin (IsLocation, optional) – Location in which this Location is contained. Defaults to None.

  • currency (Currency, optional) – Currency used in the Location. Defaults to None.

  • alsohas (tuple[IsLocation]) – Locations contained in this Location, but not directly. Defaults to ()

  • hierarchy (int, optional) – Level of hierarchy of the Location. Defaults to None.

locate(*operations: Process | Storage)[source]#

Locates the Operations

property tree: dict[Self, dict]#

Prints the tree of Locations

property parent: Self | None#

Finds the parent Location

property depth#

Finds the depth of the Location

update_hierarchy(hierarchy: int = 0)[source]#

Updates the hierarchy of the locations

property space: Space#

Space to which the Location belongs

property network: Self#

Network to which the Location belongs

property isnetwork: bool#

Is this the network of the model?

property I: I[source]#

gana index set

sink()[source]#

Tells whether the location is a sink

source()[source]#

Tells whether the location is a source

Finds the links between two Locations

Parameters:
  • location (IsLocation) – Location to find links with

  • show (bool, optional) – Whether the links are to be printed. Defaults to True.

Returns:

Links between the Locations

Return type:

list[Linkage]

connected(location, show: bool = False) bool[source]#

Finds whether the Locations are connected

Parameters:
  • location (IsLocation) – Location to verify Links with

  • show (bool, optional) – Whether to print the Links. Defaults to False.

Returns:

True if Locations are connected

Return type:

bool

all()[source]#

gives locations within

property cons: list[C]#

Constraints

property program: Prg#

Mathematical program

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

Pretty print the component

Modules

linkage

Linkage links Locations through Transits

location

Location where Operations can reside