Originally posted by: KeerthivasanC
Here is my code:
m = CpoModel(name="CP Model")
TP1 = m.integer_var_dict(name = "TP1",keys=project)
for i in project:
TP1[i].set_domain([0,1,2,3])
I want to initiate TP1 as a continuous dictionary variable and the variable should take values from this list - [0,0.5,1,1.5,2]. Unfortunately, set_domain only works for integer type variables. Is there a way to accomplish what I am seeking using constraints or some other method?
A code snippet in python would be helpful.
Thanks and Regards.
#CPLEXOptimizers#DecisionOptimization