Hull_Reformulation
(class from pyomo.gdp.plugins.hull)
- class pyomo.gdp.plugins.hull.Hull_Reformulation[source]
Bases:
GDP_to_MIP_TransformationRelax disjunctive model by forming the hull reformulation.
Relaxes a disjunctive model into an algebraic model by forming the hull reformulation of each disjunction.
This transformation accepts the following keyword arguments:
The transformation will create a new Block with a unique name beginning “_pyomo_gdp_hull_reformulation”. It will contain an indexed Block named “relaxedDisjuncts” that will hold the relaxed disjuncts. This block is indexed by an integer indicating the order in which the disjuncts were relaxed. All transformed Disjuncts will have a pointer to the block their transformed constraints are on, and all transformed Disjunctions will have a pointer to the corresponding OR or XOR constraint.
- Parameters:
perspective_function (str) – The perspective function used for the disaggregated variables. Must be one of ‘FurmanSawayaGrossmann’ (default), ‘LeeGrossmann’, or ‘GrossmannLee’
EPS (float) – The value to use for epsilon [default: 1e-4]
targets (block, disjunction, or list of those types) – The targets to transform. This can be a block, disjunction, or a list of blocks and Disjunctions [default: the instance]
Methods
__init__()Initialize transformation object.
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
get_disaggregated_var(v, disjunct[, ...])Returns the disaggregated variable corresponding to the Var v and the Disjunct disjunct.
get_disaggregation_constraint(original_var, ...)Returns the disaggregation (re-aggregation?) constraint (which links the disaggregated variables to their original) corresponding to original_var and the transformation of disjunction.
Return the original Constraint whose transformed counterpart is transformedConstraint
Return the Disjunct object whose transformed components are on transBlock.
Return the Disjunction corresponding to xor_constraint
get_src_var(disaggregated_var)Returns the original model variable to which disaggregated_var corresponds.
Return the transformed version of srcConstraint
get_var_bounds_constraint(v[, disjunct])Returns a dictionary mapping keys 'lb' and/or 'ub' to the Constraints that set a disaggregated variable to be within its lower and upper bounds (respectively) when its Disjunct is active and to be 0 otherwise.
Attributes
CONFIGtransformation_nameMember 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
- get_disaggregated_var(v, disjunct, raise_exception=True)[source]
Returns the disaggregated variable corresponding to the Var v and the Disjunct disjunct.
If v is a local variable, this method will return v.
- Parameters:
v (a Var that appears in a constraint in a transformed Disjunct)
disjunct (a transformed Disjunct in which v appears)
- get_disaggregation_constraint(original_var, disjunction, raise_exception=True)[source]
Returns the disaggregation (re-aggregation?) constraint (which links the disaggregated variables to their original) corresponding to original_var and the transformation of disjunction.
- Parameters:
original_var (a Var which was disaggregated in the transformation) – of Disjunction disjunction
disjunction (a transformed Disjunction containing original_var)
- get_src_constraint()
Return the original Constraint whose transformed counterpart is transformedConstraint
- Parameters:
transformedConstraint (Constraint, which must be a component on one of)
of (the BlockDatas in the relaxedDisjuncts Block)
block (a transformation)
- get_src_disjunct()
Return the Disjunct object whose transformed components are on transBlock.
- Parameters:
transBlock (BlockData which is in the relaxedDisjuncts IndexedBlock) – on a transformation block.
- get_src_disjunction()
Return the Disjunction corresponding to xor_constraint
- Parameters:
xor_constraint (Constraint, which must be the logical constraint) – (located on the transformation block) of some Disjunction
- get_src_var(disaggregated_var)[source]
Returns the original model variable to which disaggregated_var corresponds.
- Parameters:
disaggregated_var (a Var that was created by the hull) – transformation as a disaggregated variable (and so appears on a transformation block of some Disjunct)
- get_transformed_constraints(cons)[source]
Return the transformed version of srcConstraint
- Parameters:
srcConstraint (ScalarConstraint or ConstraintData, which must be in)
Disjunct (the subtree of a transformed)
- get_var_bounds_constraint(v, disjunct=None)[source]
Returns a dictionary mapping keys ‘lb’ and/or ‘ub’ to the Constraints that set a disaggregated variable to be within its lower and upper bounds (respectively) when its Disjunct is active and to be 0 otherwise.
- Parameters:
v (a Var that was created by the hull transformation as a) – disaggregated variable (and so appears on a transformation block of some Disjunct)
disjunct ((For nested Disjunctions) Which Disjunct in the) – hierarchy the bounds Constraint should correspond to. Optional since for non-nested models this can be inferred.