app.infra.quantity
Parameter
Bases: Quantity
Represents a scalar, static quantity used as a parameter in the model.
This subclass of Quantity stores a single numerical value and provides
methods for exporting it into a format usable by optimization solvers.
| Attributes: |
|
|---|
set(value, **kwargs)
Set the parameter's value after checking type compatibility.
- If current
_valueis None: acceptvalueand store it. - Otherwise attempt to convert
valueto the type of_value. - On failure raise
TypeError.
Quantity
Bases: ABC
Abstract base class for representing any abstract quantity (e.g. power flow, financial amount) within an entity.
Quantities may represent static scalar parameters (Parameter) or dynamic time series (TimeSeriesObject). This class defines the interface for how quantities are integrated into the optimization model.
convert(converter, **kwargs)
Converts the quantity into a pulp-compatible format (e.g., a time series array or a value-variable).
set(value, **kwargs)
Sets the value of the quantity, if applicable.