annular.optimization_model_manager

A class to manage optimization models.

Classes

OptimizationModelManager

Class to manage Pyomo optimization models.

Module Contents

class annular.optimization_model_manager.OptimizationModelManager(solver: str | pyomo.opt.base.OptSolver, model: pyomo.environ.AbstractModel | None = None)[source]

Class to manage Pyomo optimization models.

Parameters:
  • solver – Pyomo OptSolver, or a string that instantiates a Pyomo OptSolver with this argument.

  • model – Pyomo abstract model, optional.

solver[source]
model = None[source]
model_instance: pyomo.environ.ConcreteModel | None = None[source]
is_solved: bool = False[source]
set_model(model: pyomo.environ.AbstractModel) None[source]

Set a new model.

Parameters:

model – Pyomo abstract model to set.

instantiate(data: dict) None[source]

Create concrete model with instantiation data.

Parameters:

data – Dictionary with keys of model attributes and values of data to be set. The data needs to correspond to the abstract model in terms of attributes needed and their lengths, otherwise instantiation will fail.

solve() None[source]

Solve the model.