pycity_scheduling.classes.base.components package¶
Submodules¶
pycity_scheduling.classes.base.components.component module¶
- class pycity_scheduling.classes.base.components.component.Component¶
Bases:
objectBase class for all components.
Components contain the specific characteristics of symbols and expressions referenced by equations or inequalities.
- Attributes:
- symbol
Methods
add_symbol(s)Add Symbol that references this Component
create(value)Create a new Component for the specified value.
lb(a, b)Generate a lower bound for the Component in the specified interval
max(a, b)Generate a expression representing the maximum value of the Component in the specified interval
mean(a, b)Generate a mean for the Component in the specified interval.
min(a, b)Generate an expression representing the minimal value of the Component in the specified interval
register(f)Register a new child class for the Component 'create' factory
to_exp(a, b)Generate a sympy expression from this component
ub(a, b)Generate an upper bound for the Component in the specified interval
descriptive
- add_symbol(s: SymbolDefinition)¶
Add Symbol that references this Component
- Parameters:
s (SymbolDefinition) – New Symbol that references this Component
- static create(value: Any) Component¶
Create a new Component for the specified value. Component Class is automatically determined.
- descriptive()¶
- lookup = <WeakValueDictionary>¶
- max(a: float, b: float) Expr | float¶
Generate a expression representing the maximum value of the Component in the specified interval
- min(a: float, b: float) Expr | float¶
Generate an expression representing the minimal value of the Component in the specified interval
- classmethod register(f: Type[Component]) Callable¶
Register a new child class for the Component ‘create’ factory
- registry = [(<function <lambda>>, <class 'pycity_scheduling.classes.base.components.constant.Constant'>), (<function <lambda>>, <class 'pycity_scheduling.classes.base.components.expression_component.Expression'>)]¶
- static_entity_id = 0¶
- property symbol¶
pycity_scheduling.classes.base.components.constant module¶
- class pycity_scheduling.classes.base.components.constant.Constant(value)¶
Bases:
ComponentRepresents a constant for use in equations and inequalities to offer a unified interface under Component
- Parameters:
value – Scalar value to assign to this object as its constant
Methods
lb(a, b)Generate a lower bound for the Component in the specified interval
max(a, b)Generate a expression representing the maximum value of the Component in the specified interval
mean(a, b)Generate a mean for the Component in the specified interval.
min(a, b)Generate an expression representing the minimal value of the Component in the specified interval
to_exp(a, b)Generate a sympy expression from this component
ub(a, b)Generate an upper bound for the Component in the specified interval
- max(a: float, b: float) float¶
Generate a expression representing the maximum value of the Component in the specified interval
- min(a: float, b: float) float¶
Generate an expression representing the minimal value of the Component in the specified interval
pycity_scheduling.classes.base.components.control_var module¶
- class pycity_scheduling.classes.base.components.control_var.ControlVar(t: TimeSampler, replacement_func=None, interpolation='zero')¶
Bases:
ComponentComponent that represents a control action vector over time that can be influenced by the optimization
- Parameters:
t (TimeSampler) – TimeSampler used to determine horizons and the control sampling
replacement_func – Function to determine variable values with in case the variable was not created for the optimization
interpolation –
zero if the control variable should not change in between samples linear if the control variable changes linearly between samples and is continuous piecewise-linear if the control variable changes linearly between samples and doesn’t have to be continuous
Defaults to zero.
- Attributes:
- sub_symbols
Methods
lb(a, b)Generate a lower bound for the Component in the specified interval
max(a, b)Generate a expression representing the maximum value of the Component in the specified interval
mean(a, b)Generate a mean for the Component in the specified interval.
min(a, b)Generate an expression representing the minimal value of the Component in the specified interval
to_exp(a, b)Generate a sympy expression from this component
ub(a, b)Generate an upper bound for the Component in the specified interval
get_var
set_schedule
set_var
update_schedule
- get_var(s: Symbol)¶
- Parameters:
s (Symbol) –
- max(a: float, b: float) Expr¶
Generate a expression representing the maximum value of the Component in the specified interval
- min(a: float, b: float) Expr¶
Generate an expression representing the minimal value of the Component in the specified interval
- set_schedule(schedule)¶
- set_var(v)¶
- property sub_symbols¶
- update_schedule(schedule)¶
pycity_scheduling.classes.base.components.design_var module¶
- class pycity_scheduling.classes.base.components.design_var.DesignVar(value)¶
Bases:
ComponentComponent that represents a design decision that can be influenced by the optimization
Methods
lb(a, b)Generate a lower bound for the Component in the specified interval
max(a, b)Generate a expression representing the maximum value of the Component in the specified interval
mean(a, b)Generate a mean for the Component in the specified interval.
min(a, b)Generate an expression representing the minimal value of the Component in the specified interval
to_exp(a, b)Generate a sympy expression from this component
ub(a, b)Generate an upper bound for the Component in the specified interval
set_var
- max(a: float, b: float) Expr¶
Generate a expression representing the maximum value of the Component in the specified interval
- min(a: float, b: float) Expr¶
Generate an expression representing the minimal value of the Component in the specified interval
- set_var(v)¶
pycity_scheduling.classes.base.components.expression_component module¶
- class pycity_scheduling.classes.base.components.expression_component.Expression(value, used_rels=[])¶
Bases:
ComponentMethods
lb(a, b)Generate a lower bound for the Component in the specified interval
max(a, b)Generate a expression representing the maximum value of the Component in the specified interval
mean(a, b)Generate a mean for the Component in the specified interval.
min(a, b)Generate an expression representing the minimal value of the Component in the specified interval
to_exp(a, b)Generate a sympy expression from this component
ub(a, b)Generate an upper bound for the Component in the specified interval
- max(a: float, b: float) Expr¶
Generate a expression representing the maximum value of the Component in the specified interval
- min(a: float, b: float) Expr¶
Generate an expression representing the minimal value of the Component in the specified interval
pycity_scheduling.classes.base.components.signal module¶
- class pycity_scheduling.classes.base.components.signal.Signal(t: Timer, series: Series, interpolator, valid_period=(None, None))¶
Bases:
ComponentMethods
__call__(t)Call self as a function.
lb(a, b)Generate a lower bound for the Component in the specified interval
max(a, b)Generate a expression representing the maximum value of the Component in the specified interval
mean(a, b)Generate a mean for the Component in the specified interval.
min(a, b)Generate an expression representing the minimal value of the Component in the specified interval
to_exp(a, b)Generate a sympy expression from this component
ub(a, b)Generate an upper bound for the Component in the specified interval
derivative
integrate
points
- Parameters:
t (Timer) –
series (Series) –
- derivative()¶
- integrate(a, b)¶
- max(a: float, b: float) float¶
Generate a expression representing the maximum value of the Component in the specified interval
- min(a: float, b: float) float¶
Generate an expression representing the minimal value of the Component in the specified interval
- points()¶
- pycity_scheduling.classes.base.components.signal.make_interp_spline(t: Timer, series: Series, k=3, bc_type=None, valid_period=(None, None))¶
- Parameters:
t (Timer) –
series (Series) –
- pycity_scheduling.classes.base.components.signal.make_monotonic_signal(t: Timer, series: Series, valid_period=(None, None))¶
- Parameters:
t (Timer) –
series (Series) –
- pycity_scheduling.classes.base.components.signal.make_periodic_signal(t: Timer, series: Series, k=2, valid_period=(None, None))¶
- Parameters:
t (Timer) –
series (Series) –