energia.dimensions.space#

Space

Functions

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

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

Classes

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

Linkage between two Locations.

Location(*has[, label, citations])

A discretization of Space.

Space(model)

Spatial representation of the system.

class Space(model: Model)[source]#

Bases: _Dimension

Spatial representation of the system.

All spatial components are attached to this object.

Parameters:

model (Model) – Model to which the representation belongs.

Variables:
  • name (str) – Name of the dimension, auto generated

  • locations (list[Loc]) – List of locations in the space.

  • sources (list[Loc]) – List of source locations.

  • sinks (list[Loc]) – List of sink locations.

  • linkages (list[Link]) – List of linkages in the space.

  • label (str) – Label for the space.

  • default (Loc) – Default location for the space. Defaults to None.

  • network (Loc) – The encompassing region (network) of the space.

  • s (list[Loc | Link]) – List of spatial components (locations and linkages).

  • tree (dict) – Nested dictionary of locations.

  • hierarchy (dict[int, list[Loc]]) – position on tree.

Note

  • name is self generated

  • locations, sources, sinks, and linkages are populated as model is defined

  • label is fixed

  • default is set to None initially and is updated when needed (see network property)

property tree: dict#

creates a nested dictionary of locations

property hierarchy: dict[int, list[Location]]#

gives position in tree

property not_nested: list[Location]#

List of locations that are not nested under another location

property network: Location#

An encompassing location

property s: list[Location | Linkage]#

List of spatial components

split(loc: Location) tuple[list[Location], Location | None][source]#

Gives a list of locations at a higher and lower hierarchy than loc

model: Model#