TemporarySubsystemManager

(class from pyomo.util.subsystems)

class pyomo.util.subsystems.TemporarySubsystemManager(to_fix=None, to_deactivate=None, to_reset=None, to_unfix=None, remove_bounds_on_fix=False)[source]

Bases: object

This class is a context manager for cases when we want to temporarily fix or deactivate certain variables or constraints in order to perform some solve or calculation with the resulting subsystem.

__init__(to_fix=None, to_deactivate=None, to_reset=None, to_unfix=None, remove_bounds_on_fix=False)[source]
Parameters:
  • to_fix (List) – List of var data objects that should be temporarily fixed. These are restored to their original status on exit from this object’s context manager.

  • to_deactivate (List) – List of constraint data objects that should be temporarily deactivated. These are restored to their original status on exit from this object’s context manager.

  • to_reset (List) – List of var data objects that should be reset to their original values on exit from this object’s context context manager.

  • to_unfix (List) – List of var data objects to be temporarily unfixed. These are restored to their original status on exit from this object’s context manager.

  • remove_bounds_on_fix (Bool) – Whether bounds should be removed temporarily for fixed variables

Methods

__init__([to_fix, to_deactivate, to_reset, ...])

Member Documentation