energia.components.spatial.location#

Location where Operations can reside

Functions

get_depth(d)

Finds the depth of a dictionary.

is_(a, b, /)

Same as a is b.

warn

Issue a warning, or maybe ignore it or raise an exception.

Classes

Idx

alias of I

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

Linkage between two Locations.

Location(*has[, label, citations])

A discretization of Space.

cached_property(func)

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