energia.components.spatial#
energia.spatial init file
Classes
|
Linkage between two Locations. |
|
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:
_XLinkage 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:
- property isnetwork: bool#
Is this the network of the model? Linkage can never be the network
- 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:
_XA 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.
- 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
- property network: Self#
Network to which the Location belongs
- property isnetwork: bool#
Is this the network of the model?
- links(location, show: bool = True) list[Linkage][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
- property cons: list[C]#
Constraints
- property program: Prg#
Mathematical program
- show(descriptive=False, category: str = '')#
Pretty print the component
Modules