(function from pyomo.contrib.mindtpy.util)
pyomo.contrib.mindtpy.util
This function tries to set a valid value for variable with the given input. Rounds to Binary/Integer if necessary. Sets to zero for NonNegativeReals if necessary.
var (Var) – The variable that needs to set value.
var_val (float) – The desired value to set for var.
integer_tolerance (float) – Tolerance on integral values.
zero_tolerance (float) – Tolerance on variable equal to zero.
ignore_integrality (bool, optional) – Whether to ignore the integrality of integer variables, by default False.
ValueError – Cannot successfully set the value to the variable.