energia.components.operations.storage#

Storage - Stashes Resource to Withdraw Later

Functions

retry(func[, attempts, exceptions])

Retry a function a number of times if it raises specified exceptions.

timer(logger[, kind, level])

Logs execution time and optionally shows a full computation using function arguments and result.

Classes

Charge(storage, *args, **kwargs)

Process that Charges Storage

Construction([operation, aspect, resource, ...])

Operation Construction Conversion

Conversion([aspect, add, sub, operation, ...])

Processes convert one Commodity to another Commodity Conversion provides the conversion of resources

Discharge(storage, *args, **kwargs)

Process that Discharges Storage

Process(*args[, label, citations])

Process converts one Resource to another Resource at some Location

Resource([basis, label, citations])

A resource, can be a material, chemical, energy, etc.

Storage(*args[, label, citations])

Storage is a container for three main elements: 1.

Stored(*args, **kwargs)

Resource in Storage

cached_property(func)

class Stored(*args, **kwargs)[source]#

Bases: Resource

Resource in Storage

property I#

gana index set (I)

property balance: dict[Conversion | Self, int | float]#

Conversion

property cons: list[C]#

Constraints

get(k[, d]) D[k] if k in D, else d.  d defaults to None.#
property horizon: Periods#

Circumscribing Periods (Temporal Scale)

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

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

Pretty print the component

property space: Space#

Space

property time: Time#

Time

values() an object providing a view on D's values#
class Charge(storage: Storage, *args, **kwargs)[source]#

Bases: Process

Process that Charges Storage

property I#

gana index set (I)

property balance: dict[Resource, int | float]#

Conversion of commodities

property basis: Resource#

Base resource

property capacity_aspect: Aspect#

Capacity Aspect

property capacity_sample: Sample#

Capacity Sample

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property lag: Lag#

Lag of the process

locate(*spaces: Location | Linkage)#

Locate the process

property network: Location#

Circumscribing Loc (Spatial Scale)

property operate_aspect: Aspect#

Operate Aspect

property operate_sample: Sample#

Operate Sample

property problem: Problem#

Feasible Region

property production#

Alias for primary_conversion

property program: Prg#

Mathematical program

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

Pretty print the component

property space: Space#

Space

property spaces: list[Location]#

Locations at which the process is balanced

property time: Time#

Time

write_construction(space_times: list[tuple[Location | Linkage, Periods]])#

write fabrication constraints for the operation

write_primary_conversion(space_times: list[tuple[Location, Periods]])#

Write the production constraints for the process

class Discharge(storage: Storage, *args, **kwargs)[source]#

Bases: Process

Process that Discharges Storage

property I#

gana index set (I)

property balance: dict[Resource, int | float]#

Conversion of commodities

property basis: Resource#

Base resource

property capacity_aspect: Aspect#

Capacity Aspect

property capacity_sample: Sample#

Capacity Sample

property cons: list[C]#

Constraints

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property lag: Lag#

Lag of the process

locate(*spaces: Location | Linkage)#

Locate the process

property network: Location#

Circumscribing Loc (Spatial Scale)

property operate_aspect: Aspect#

Operate Aspect

property operate_sample: Sample#

Operate Sample

property problem: Problem#

Feasible Region

property production#

Alias for primary_conversion

property program: Prg#

Mathematical program

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

Pretty print the component

property space: Space#

Space

property spaces: list[Location]#

Locations at which the process is balanced

property time: Time#

Time

write_construction(space_times: list[tuple[Location | Linkage, Periods]])#

write fabrication constraints for the operation

write_primary_conversion(space_times: list[tuple[Location, Periods]])#

Write the production constraints for the process

class Storage(*args, label: str = '', citations: str = '', **kwargs)[source]#

Bases: _Component

Storage is a container for three main elements: 1. A Stored resource 2. A charge Process that puts the resource into storage 3. A discharge Process that withdraws the resource from storage

Parameters:
  • basis (Unit, optional) – Unit basis of the component. Defaults to None.

  • label (str, optional) – An optional label for the component. Defaults to None.

  • citations (str | list[str] | dict[str, str | list[str]], optional) – An optional citation or description for the component. Defaults to None.

  • store (Resource, optional) – The resource to be stored. Defaults to None.

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

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

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

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

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

  • stored (Stored, optional) – The resource being stored. Defaults to None.

  • conversion (Conversion, optional) – Operational conversion associated with the storage. Defaults to None.

  • _conv (bool) – True if the operational conversion has been set. Defaults to False.

  • charge (Process) – The charge process associated with the storage.

  • discharge (Process) – The discharge process associated with the storage.

  • locations (list[Location]) – List of locations where the storage is located. Defaults to [].

property space_times: list[tuple[Location, Periods]][source]#

List of location, time tuples where storage is located

property capacity_aspect: Aspect[source]#

Reports invcapacity as aspect

property inventory_aspect: Aspect[source]#

Reports inventory as aspect

property basis: Resource#

Base resource

property storage_cost: Sample#

Cost of storing the resource

property cons: list[C]#

Constraints

write_construction(space_times: list[tuple[Location, Periods]])[source]#

write fabrication constraints for the operation

locate(*spaces: Location)[source]#

Locate the storage

property I#

gana index set (I)

property horizon: Periods#

Circumscribing Periods (Temporal Scale)

property network: Location#

Circumscribing Loc (Spatial Scale)

property problem: Problem#

Feasible Region

property program: Prg#

Mathematical program

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

Pretty print the component

property space: Space#

Space

property time: Time#

Time