decogo.solver.decogo

Main module for running the solution process

Classes

DecogoLogger(level[, file_name])

A class which is responsible for the logging of the solver.

DecogoProcess(input_model[, file_name])

A class which is responsible for solver process.

DecogoSolver()

A class which starts the solution process

DecogoSolverManager()

A class which manages algorithms of the solver.

class decogo.solver.decogo.DecogoSolver[source]

A class which starts the solution process

static _remove_unpicklable_objects_pyomo_model(model)[source]

Removes unpicklable objects from Pyomo model object. This is because multiprocessing is based on serialization and some objects cannot be serialized (pickled). This method does the following:

  • removes objects Port and Arcs, since they contain weakref objects

  • sets to None the ‘rule’ property for Constraint, Objective and Param, since it might contain lambda function

  • sets to None property ‘initialize’ and ‘_init_values._init’ for Set, since it might contain lambda function

Parameters:

model (ConcreteModel) – Pyomo model

optimize(input_model, file_name=None)[source]

Main driver method which starts the process of solving

Parameters:
  • input_model (ConcreteModel) – Pyomo model

  • file_name (str or None) – Name of the file where the logging information written

class decogo.solver.decogo.DecogoProcess(input_model, file_name=None)[source]

A class which is responsible for solver process. The main idea of this class is reliable way to set maximum executation time of the whole solver.

Parameters:
  • input_model (ConcreteModel) – Pyomo model

  • file_name (str or None) – Name of the file where the log info should be written

  • solver (DecogoSolverManager) – Solver manager

  • solver_thread (Thread) – solver single thread which runs the solver

__init__(input_model, file_name=None)[source]

Constructor method

run()[source]

Method for running the solver

_exit()[source]

Finishes the process and all sub-processes and exits

close()[source]

Closes process

get_max_time()[source]

Gets max time for running the solver process

class decogo.solver.decogo.DecogoSolverManager[source]

A class which manages algorithms of the solver. It performs the decomposition, creates the settings, calls the algorithms and stores the results

Parameters:
__init__()[source]

Constructor method

solve(input_model, file_name=None)[source]

Performs basic operations of the solver: decomposition, algorithm execution and showing the results

Parameters:
  • input_model (ConcreteModel) – Input Pyomo model

  • file_name (str or None) – Name of the file where the logs should be stored

_automatic_decomposition(input_model, user_defined_model=False)[source]

Peforms automatic decomposition of the input model

Parameters:

input_model (ConcreteModel) – Input Pyomo model

class decogo.solver.decogo.DecogoLogger(level, file_name=None)[source]

A class which is responsible for the logging of the solver. It sets up the logs of the solver

__init__(level, file_name=None)[source]

Constructor method

_set_up_into_file(file_name, level)[source]

Sets up the logger into file

Parameters:
  • file_name (str) – Name of the file

  • level (logging.DEBUG, logging.INFO etc) – logger level

_set_up_into_console(level)[source]

Sets up the logger into console

Parameters:

level (logging.DEBUG, logging.INFO etc) – logger level

clean_up()[source]

Cleans all logger handlers