Hi everyone,
I have a docplex model where I create a set of variables using something similar to
m = Model(...)
# the initial set is not relevant I think
x = m.continuous_var_dict((k for k in ...), name="x")
# get a solution
s = m.solve()
When I query s for the value of x, one entry is missing. I cannot share the list of keys as it's very large, but basically
# shows the correct keys, e.g., 10 keys
print(x.keys())
# some key in x.keys()
k = ...
assert k in x # this is ok
# I can query the value using .get_value(), this returns a very small (negative?) number,
# e.g., -9.094947017729282e-13 (the value has a 0 lower-bound)
k_value = s.get_value(x[k])
# I can query the dictionary from x
x_values = s.get_value_dict(x)
# ...but the key is missing
assert k in x_values # this fails
Any idea why this happens? I tried forcing keep_zeros to True in get_value_dict() (which should already be there since it's the default) but it did not change anything.
------------------------------
Mikaël Capelle
------------------------------
#DecisionOptimization