PersistentSolverUtils

(class from pyomo.contrib.solver.common.persistent)

class pyomo.contrib.solver.common.persistent.PersistentSolverUtils(treat_fixed_vars_as_params=True)[source]

Bases: ABC

__init__(treat_fixed_vars_as_params=True)[source]
Parameters:

treat_fixed_vars_as_params (bool) – This is an advanced option that should only be used in special circumstances. With the default setting of True, fixed variables will be treated like parameters. This means that z == x*y will be linear if x or y is fixed and the constraint can be written to an LP file. If the value of the fixed variable gets changed, we have to completely reprocess all constraints using that variable. If treat_fixed_vars_as_params is False, then constraints will be processed as if fixed variables are not fixed, and the solver will be told the variable is fixed. This means z == x*y could not be written to an LP file even if x and/or y is fixed. However, updating the values of fixed variables is much faster this way.

Methods

__init__([treat_fixed_vars_as_params])

add_block(block)

add_constraints(cons)

add_parameters(params)

add_sos_constraints(cons)

add_variables(variables)

remove_block(block)

remove_constraints(cons)

remove_parameters(params)

remove_sos_constraints(cons)

remove_variables(variables)

set_instance(model)

set_objective(obj)

update([timer])

update_parameters()

update_variables(variables)

Member Documentation