Originally posted by: rakesh85
I am trying to use the 'member' function in Python inside if_then. However, I am getting the error in the solution stage (and not in the model building stage). Please look at the formulated constraint:
mdl.add( if_then ( mdl.member ( 1, [1,2,3] ), x==2).
The error I am getting is the following:
"Solver error: Error reading model from <stream> (<ipython-input-154-c271cd74d003>:39(stream:19:1): Error: 'member' is not a function.)"
Appreciate your help.
Originally posted by: Olivier OUDOT
You have found a bug in our Python interface, thanks a lot for that. In fact, the function 'member' is deprecated since COS 12.7 and has been replaced by 'allowed_assignments'. If you change your code with this function, it will work.
We will fix the problem in a next release !
Thanks for using our product.