decogo.pyomo_input_model.subproblem

This module implements and manages all sub-problems

Classes

PyomoLineSearchSubProblem(sub_models, cuts, ...)

This class defines line search sub-problem between exterior point \(x_k^{ext}\) and interior point \(x_k^{int}\)

PyomoMinlpSubProblem(sub_models, cuts, block_id)

A class for defining the following sub-problem

PyomoProjectionSubProblem(sub_models, cuts, ...)

Class for defining a projection sub-problem

PyomoResourceProjectionSubProblem(...)

A class for defining a projection sub-problem

PyomoSubProblemBase(sub_models, cuts, block_id)

A base class for construction of Pyomo model.

class decogo.pyomo_input_model.subproblem.PyomoSubProblemBase(sub_models, cuts, block_id)[source]

A base class for construction of Pyomo model. Here are implemented methods for creating local linear and nonlinear constraints

Parameters:
  • sub_models (list) – List of sub-models

  • cuts (CutPool) – Container which stores all linear constraints (global and local) and objective function

  • block_id (int) – Block identifier

__init__(sub_models, cuts, block_id)[source]

Constructor method

solve(solver_name, start_point=None, solver_options=None)[source]

Base method for calling the external solver to solve the model

Parameters:
  • solver_name (str) – External solver name

  • start_point (ndaray or None) – Starting point for the solver, defaults to None

  • solver_options (list) – Options for external solver, defaults to None

Returns:

Solution point, primal bound, dual bound, flag if the primal bound is feasible

Return type:

tuple

add_linear_constraint()[source]

Adds new linear constraint

set_nlp()[source]

Relaxes integer varaibles to continious

unset_nlp()[source]

Sets to integer type for the variables which are integer in the original formulation

update_var_lower_bound(index)[source]

Updates the lower bound of the variable. The value is taken form the BlockModel

Parameters:

index (tuple) – Index (block_id, index)

update_var_upper_bound(index)[source]

Updates the upper bound of the variable. The value is taken form the BlockModel

Parameters:

index (tuple) – Index (block_id, index)

fix_integers(x)[source]

Fixes integer variables with given value

Parameters:

x (ndarray) – Given array

unfix_integers()[source]

Unfixes all integer variables

add_objective()[source]

Sets default objective function, i.e. \(c_k^Tx_k\), where \(c_k\) - partial objective from the original model

set_objective(direction)[source]

Sets the objective function with given direction vector

Parameters:

direction (ndarray) – Given vector

class decogo.pyomo_input_model.subproblem.PyomoMinlpSubProblem(sub_models, cuts, block_id)[source]

A class for defining the following sub-problem

\[\begin{equation} \begin{split} \min \ &d_k^Ty_k, \newline &y_k \in X_k, d_k \in \mathbb{R}^{n_k} \end{split} \end{equation}\]
Parameters:
  • sub_models (list) – List of sub-models

  • cuts (CutPool) – Container which stores all linear constraints (global and local) and objective function

  • block_id (int) – Block identifier

__init__(sub_models, cuts, block_id)[source]

Constructor method

class decogo.pyomo_input_model.subproblem.PyomoProjectionSubProblem(sub_models, cuts, block_id)[source]

Class for defining a projection sub-problem

\[\begin{equation} \begin{split} \min \ &||y_k-x_k||^2,\newline &y_k \in G_k, x_k \text{ is fixed} \end{split} \end{equation}\]
Parameters:
  • sub_models (list) – List of sub-models

  • cuts (CutPool) – Container which stores all linear constraints (global and local) and objective function

  • block_id (int) – Block identifier

__init__(sub_models, cuts, block_id)[source]

Constructor method

obj_rule()[source]

Defines the objective function

Returns:

Objective expression

Return type:

Expression

set_projection_point(point_to_project)[source]

Sets projection point, i.e. \(x_k\)

Parameters:

point_to_project (ndarray) – Projection point

class decogo.pyomo_input_model.subproblem.PyomoResourceProjectionSubProblem(sub_models, cuts, block_id)[source]

A class for defining a projection sub-problem

\[\begin{equation} \begin{split} \min \ &||A_kx_k - w_k||^2,\newline &y_k \in G_k, w_k \text{ is fixed} \end{split} \end{equation}\]
Parameters:
  • sub_models (list) – List of sub-models

  • cuts (CutPool) – Container which stores all linear constraints (global and local) and objective function

  • block_id (int) – Block identifier

__init__(sub_models, cuts, block_id)[source]

Constructor method

obj_rule()[source]

Defines the objective function

Returns:

Objective expression

Return type:

Expression

set_projection_point(point_to_project)[source]

Sets projection point, i.e. \(w_k\)

Parameters:

point_to_project (ndarray) – Projection point

class decogo.pyomo_input_model.subproblem.PyomoLineSearchSubProblem(sub_models, cuts, block_id)[source]

This class defines line search sub-problem between exterior point \(x_k^{ext}\) and interior point \(x_k^{int}\)

\[\begin{equation} \begin{split} \max \ & \alpha, \newline &y_k = \alpha x_k^{ext} + (1 - \alpha) x_k^{int}, \newline &y_k \in X_k \end{split} \end{equation}\]
Parameters:
  • sub_models (list) – List of sub-models

  • cuts (CutPool) – Container which stores all linear constraints (global and local) and objective function

  • block_id (int) – Block identifier

__init__(sub_models, cuts, block_id)[source]

Constructor method

set_interior_exterior_points(exterior_point, interior_point)[source]

Sets values of two endpoints

Parameters:
  • exterior_point (ndarray) – Exterior point

  • interior_point (ndarray) – Interior point

solve(solver_name, start_point=None, solver_options=None)[source]

Solves the subproblem and gets value of \(\alpha\). For more info, see base method SubProblemBase.solve()