FixedVarDetector

(class from pyomo.contrib.preprocessing.plugins.detect_fixed_vars)

class pyomo.contrib.preprocessing.plugins.detect_fixed_vars.FixedVarDetector(**kwds)[source]

Bases: IsomorphicTransformation

Detects variables that are de-facto fixed but not considered fixed.

For each variable \(v\) found on the model, check to see if its lower bound \(v^{LB}\) is within some tolerance of its upper bound \(v^{UB}\). If so, fix the variable to the value of \(v^{LB}\).

Keyword arguments below are specified for the apply_to and create_using functions.

Keyword Arguments:
  • tmp (bool, default=False) – True to store the set of transformed variables and their old values so that they can be restored.

  • tolerance (NonNegativeFloat, default=1e-13) – tolerance on bound equality (LB == UB)

__init__(**kwds)

Methods

__init__(**kwds)

apply(model, **kwds)

DEPRECATED.

apply_to(model, **kwds)

Apply the transformation to the given model.

create_using(model, **kwds)

Create a new model with this transformation

revert(instance)

Revert variables fixed by the transformation.

Attributes

CONFIG

Member Documentation

apply(model, **kwds)

DEPRECATED.

Deprecated since version 4.3.11323: Transformation.apply() has been deprecated. Please use either Transformation.apply_to() for in-place transformations or Transformation.create_using() for transformations that create a new, independent transformed model instance.

apply_to(model, **kwds)

Apply the transformation to the given model.

create_using(model, **kwds)

Create a new model with this transformation

revert(instance)[source]

Revert variables fixed by the transformation.