(函数来自 pyomo.contrib.gdpopt.util)
pyomo.contrib.gdpopt.util
将离散变量 var 固定为 val,根据配置中是否指定了舍入以及整数容差的大小,决定是否舍入到最接近的整数。