Hi All,
I'm trying to solve a stochastic problem with probabilities but am having a problem.
I can't multiply an IntVar by a double:
x = solver.IntVar(0,999, 'x')
solver.Add(0.6*x >= 500)
I get the following error:
TypeError: in method 'IntExpr___rmul__', argument 2 of type 'int64'
Is there a way to create a variable that can be multiplied by a double?
Is ScaProd() useful here?
An alternate approach would be to multiply all values by 100, so that I have:
x = solver.IntVar(0,99900, 'x')
solver.Add(600*x >= 50000)
But then I would need to increment the search by 100, instead of 1,
Is this possible?
I could add the following but would prefer to omit additional constraints:
solver.Add((x % 100) == 0)
Thanks in advance.
Bart