fix_discrete_var

(function from pyomo.contrib.gdpopt.util)

pyomo.contrib.gdpopt.util.fix_discrete_var(var, val, config)[source]

Fixes the discrete variable var to val, rounding to the nearest integer or not, depending on if rounding is specified in config and what the integer tolerance is.