comando package
Subpackages
- comando.interfaces package
- Submodules
- comando.interfaces.baron module
- comando.interfaces.dyos module
- comando.interfaces.gams module
- comando.interfaces.gurobi module
- comando.interfaces.maingo_ale module
- comando.interfaces.maingo_api module
- comando.interfaces.modelica module
- comando.interfaces.pyomo module
- comando.interfaces.pyomo_dae module
- comando.interfaces.quboify module
- comando.interfaces.scip module
- Module contents
- Submodules
Submodules
- comando.core module
ComponentComponent.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.constraintsComponent.constraints_dictComponent.declare_state()Component.design_variablesComponent.design_variables_dictComponent.existing_componentsComponent.expressionsComponent.expressions_dictComponent.get_expression()Component.labelComponent.make_design_variable()Component.make_operational_variable()Component.make_parameter()Component.make_state()Component.operational_variablesComponent.operational_variables_dictComponent.parametersComponent.parameters_dictComponent.statesComponent.states_dict
ConnectorConnectorUnionDataProxyDiscretizationParametersImpossibleConstraintExceptionParameterProblemProblem.TProblem.add_symbols()Problem.dataProblem.designProblem.design_objectiveProblem.get_constraint_violations()Problem.indexProblem.initial_statesProblem.load_variable_values()Problem.num_consProblem.num_varsProblem.objectiveProblem.operationProblem.operational_objectiveProblem.scenario_weightsProblem.scenariosProblem.store_variable_values()Problem.subs()Problem.timestepsProblem.weighted_sum()
SlotSerializationMixinSymbolSystemSystem.add()System.aggregate_component_expressions()System.close_connector()System.componentsSystem.connect()System.constraintsSystem.constraints_dictSystem.create_problem()System.design_variablesSystem.design_variables_dictSystem.detach()System.expose_connector()System.expressionsSystem.expressions_dictSystem.extend_connection()System.get_open_connectors()System.operational_variablesSystem.operational_variables_dictSystem.parametersSystem.parameters_dictSystem.remove()System.statesSystem.states_dict
VariableVariableVectorVariableVector.boundsVariableVector.discretizationVariableVector.domainVariableVector.elementsVariableVector.expansionVariableVector.fix()VariableVector.indicesVariableVector.init_valVariableVector.instantiate()VariableVector.is_binaryVariableVector.is_expandedVariableVector.is_indexedVariableVector.is_integerVariableVector.is_negativeVariableVector.is_nonnegativeVariableVector.is_nonpositiveVariableVector.is_positiveVariableVector.itemsVariableVector.lbVariableVector.ubVariableVector.unfix()VariableVector.value
is_trivial()
- comando.linearization module
- comando.utility module
DefaultStringMapRootFindingErrorStrParseras_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()is_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:
EnumSimple Enum for variable domains, specify other types via bounds.
- BINARY = 3
- INTEGER = 2
- REAL = 1
- class comando.Symbol(name, **assumptions)[source]
Bases:
SlotSerializationMixin,SymbolA placeholder for a value which can occur within expressions.
- property is_indexed
Check if the Symbol is indexed.
- property value
Get the Symbol’s value.
- comando.evaluate(expr, idx=None)[source]
Evaluate the given expression at the symbols’ current values.
Note
To allow for indexed espressions to be evaluated, evaluate uses numpy and thus double arithmetic instead of the arbitrary precision arithmetic usually used by sympy or symengine backends. This can result in different results in comparison to those obtained by other tools such as solvers or AMLs interfaced to COMANDO.
- Arguments:
expr (comando.Expr) – The expression to be evaluated
idx (double, str, list, tuple) – The index at which to evaluate
returns
result (float or pandas.Series) – The numerical result of the evaluation
- class comando.Parameter(name, value=nan, parent=None)[source]
Bases:
SymbolA Symbol representing a parameter whose value is known.
- property elements
- expansion
- property indices
- property is_indexed
Check whether the Parameter is indexed or not.
- 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), discretization: DiscretizationParameters = None, init_val=None, indexed=False, parent=None)[source]
Bases:
SymbolA Symbol representing a variable whose value is unknown.
- property bounds
- property discretization
- property domain
- property init_val
- 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
- property value
Get the Symbol’s value.
- class comando.VariableVector(name, domain=Domain.REAL, bounds=(None, None), discretization: DiscretizationParameters = None, init_val=None)[source]
Bases:
SymbolA Symbol representing a vector of Variables.
- property bounds
- property discretization
- property domain
- property elements
- expansion
- property indices
- property init_val
- property is_binary
- property is_expanded
- property is_indexed
Check if the Symbol is indexed.
- 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
- property value
Get the Symbol’s value.