replace_vars_with_params

(function from pyomo.contrib.pyros.util)

pyomo.contrib.pyros.util.replace_vars_with_params(block, var_to_param_map)[source]

Substitute ParamData objects for VarData objects in the Expression, Constraint, and Objective components declared on a block and all its sub-blocks.

Note that when performing the substitutions in the Constraint and Objective components, named Expressions are descended into, but not replaced.

Parameters:
  • block (BlockData) – Block on which to perform the substitution.

  • var_to_param_map (ComponentMap) – Mapping from VarData objects to be replaced to the ParamData objects to be introduced.