decogo.pyomo_problem.master_problem_base¶
This module implements base class for master problems.
Classes
|
A base class for master problems in original space |
- class decogo.pyomo_problem.master_problem_base.MasterProblemBase(block_model)[source]¶
A base class for master problems in original space
- Parameters:
block_model (PyomoBlockModel) – Block model
model (ConcreteModel) – Pyomo model
- set_new_objective(direction)[source]¶
Sets linear objective function with given direction vector
- Parameters:
direction (BlockVector) – Given vector
- relax_integers(block_id=None)[source]¶
Relaxes all variables to continuous in pyomo model
- Parameters:
block_id (int ot None) – Block identifier, defaults to
None. If this parameter is given, then relaxation is set only for this block
- set_integers(block_id=None)[source]¶
Sets integer varaibles as in original formulation
- Parameters:
block_id (int ot None) – Block identifier, defaults to
None. If this parameter is given, then setting back is done only for this block
- fix_all_variables(point, block_id)[source]¶
Fixes all variables to some values, except for one block
- Parameters:
point (BlockVector) – Given to fix at
block_id (int) – Block identifier where are NOT fixed
- fix_integers(point, blocks=None)[source]¶
Fixes integer variables using the given point. Integer variables can be fixed either in all block or at some of the blocks
- Parameters:
point (BlockVector) – Given point to fix
blocks (list or set) – Blocks where to fix the integer variables, defaults to
None. If this value isNonein all blocks integers are fixed
- add_linear_local_constraint(block_id)[source]¶
Adds linear local constraint which is already stored in BlockModel
- Parameters:
block_id (int) – Block identifier
- update_optimality_cut(rhs)[source]¶
Adds an optimality cut, i.e. \(c^Tx \leq c_0\)
- Parameters:
rhs (float) – Right hand side of the constraint (in fact, primal bound)
- update_var_lower_bound(index)[source]¶
Updates the lower bound by given index
- Parameters:
index (tuple) – Index as pair (block_id, index)
- update_var_upper_bound(index)[source]¶
Updates the upper bound by given index
- Parameters:
index (tuple) – Index as pair (block_id, index)
- solve(solver_name, start_point=None, solver_options=None)[source]¶
Solves the model by calling an external solver and gets back the result
- Parameters:
solver_name (str) – External solver name
start_point (BlockVector or None) – Starting point for the solver, defaults to
Nonesolver_options (list or None) – External solver options, defaults to
None
- Returns:
Solution point, objective value, dual solution and flag indicating whether the solution is feasible
- Return type:
tuple