comando package
Subpackages
- comando.interfaces package
Submodules
- comando.core module
Component
Component.add_connector()
Component.add_connectors()
Component.add_eq_constraint()
Component.add_expression()
Component.add_ge_constraint()
Component.add_input()
Component.add_le_constraint()
Component.add_output()
Component.constraints
Component.constraints_dict
Component.declare_state()
Component.design_variables
Component.design_variables_dict
Component.existing_components
Component.expressions
Component.expressions_dict
Component.get_expression()
Component.label
Component.make_design_variable()
Component.make_operational_variable()
Component.make_parameter()
Component.make_state()
Component.operational_variables
Component.operational_variables_dict
Component.parameters
Component.parameters_dict
Component.states
Component.states_dict
Connector
ConnectorUnion
DataProxy
ImpossibleConstraintException
Problem
Problem.T
Problem.add_symbols()
Problem.data
Problem.design
Problem.design_objective
Problem.get_constraint_violations()
Problem.index
Problem.initial_states
Problem.load_variable_values()
Problem.num_cons
Problem.num_vars
Problem.objective
Problem.operation
Problem.operational_objective
Problem.scenario_weights
Problem.scenarios
Problem.store_variable_values()
Problem.subs()
Problem.timesteps
Problem.weighted_sum()
System
System.add()
System.aggregate_component_expressions()
System.close_connector()
System.components
System.connect()
System.constraints
System.constraints_dict
System.create_problem()
System.design_variables
System.design_variables_dict
System.detach()
System.expose_connector()
System.expressions
System.expressions_dict
System.extend_connection()
System.get_open_connectors()
System.operational_variables
System.operational_variables_dict
System.parameters
System.parameters_dict
System.remove()
System.states
System.states_dict
is_trivial()
- comando.linearization module
- comando.utility module
DefaultStringMap
RootFindingError
StrParser
as_numer_denom()
bEq()
bGe()
bLe()
bounds()
bounds_cost_turton()
canonical_file_name()
check_reuse_or_overwrite()
cleanup()
cont_univ_bounds()
define_function()
depth()
evaluate()
floor_substitute_bounds()
fuzzy_not()
get_index()
get_latest()
get_pars()
get_type_name()
get_vars()
handle_state_equations()
identity()
indexed()
is_negated()
lambdify()
lmtd_bounds()
make_function()
make_mayer_objective()
make_str_func()
make_tac_objective()
mul_bounds()
parse()
pow_bounds()
precedence()
prod()
prod_bounds()
rlmtd_bounds()
silence()
smooth_abs()
smooth_max()
smooth_min()
split()
str_parse()
sum_bounds()
syscall()
- comando.visualization module
Module contents
Configuration of the backends for COMANDO.
- class comando.Domain(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
Simple Enum for variable domains, specify other types via bounds.
- BINARY = 3
- INTEGER = 2
- REAL = 1
- class comando.Symbol(name, **assumptions)
Bases:
SlotSerializationMixin
,Symbol
A placeholder for a value which can occur within expressions.
- property indexed
Check if the Symbol is indexed.
- property is_Parameter
- property is_Variable
- property value
Get the Symbol’s value.
- class comando.Parameter(name, value=nan, parent=None)
Bases:
Symbol
A Symbol representing a parameter whose value is known.
- property elements
- expand(data)
Expand the Parameter with indexed data.
- expansion
- property indexed
Check whether the Parameter is indexed or not.
- property indices
- property is_Parameter
- property items
- property parent
Return the parent of this parameter.
- property value
Return the value or values of the Parameter.
- class comando.Variable(name, domain=Domain.REAL, bounds=(None, None), init_val=None, indexed=False, parent=None)
Bases:
Symbol
A Symbol representing a variable whose value is unknown.
- property bounds
- property domain
- fix(value=None)
Fix the variable by setting both bounds to value.
- property init_val
- property is_Variable
- property is_binary
- property is_integer
- property is_negative
Check if all possible values of the variable are negative.
We can assert negativity if the upper bound is negative, otherwise we can assert nonnegativity if the lower bound is nonnegative. If we cannot assert either of these facts, the variable may contain both positive and negative values. To reflect this we return None.
- property is_nonnegative
Check if all possible values of the variable are negative.
This is the fuzzy not of self.is_negative
- property is_nonpositive
Check if all possible values of the variable are negative.
This is the fuzzy not of self.is_negative
- property is_positive
Check if all possible values of the variable are positive.
We can assert positivity if the lower bound is positive, otherwise we can assert nonpositivity if the upper bound is nonpositive. If we cannot assert either of these facts, the variable may contain both positive and negative values. To reflect this we return None.
- property lb
- property parent
Return the parent of this variable.
- property ub
- unfix()
Recover the original bounds.
- property value
Get the Symbol’s value.
- class comando.VariableVector(name, domain=Domain.REAL, bounds=(None, None), init_val=None)
Bases:
Symbol
A Symbol representing a vector of Variables.
- property bounds
- property domain
- property elements
- expansion
- fix(value=None)
Fix self.elements by setting both bounds to value.
- property indexed
Check if the Symbol is indexed.
- property indices
- property init_val
- instantiate(index)
Create a Variable instance for every element in index.
- property is_Variable
- property is_binary
- property is_expanded
- property is_integer
- property is_negative
Check if all possible values of the variable are negative.
We can assert negativity if the upper bound is negative, otherwise we can assert nonnegativity if the lower bound is nonnegative. If we cannot assert either of these facts, the variable may contain both positive and negative values. To reflect this we return None.
- property is_nonnegative
Check if all possible values of the variable are negative.
This is the fuzzy not of self.is_negative
- property is_nonpositive
Check if all possible values of the variable are negative.
This is the fuzzy not of self.is_negative
- property is_positive
Check if all possible values of the variable are positive.
We can assert positivity if the lower bound is positive, otherwise we can assert nonpositivity if the upper bound is nonpositive. If we cannot assert either of these facts, the variable may contain both positive and negative values. To reflect this we return None.
- property items
- property lb
- property ub
- unfix()
Recover the original bounds.
- property value
Get the Symbol’s value.