Using OPL I could do the write below constraint.Mainly I used or(||) within a constraint and successfully get the results.na_supply_component is 2d decision variable
// MOQ (Minimum Order Quantity)
con2: forall(i in 1..12,j in 1..5)
na_supply_component[j,i]>=na_moq_supplier[j] || na_supply_component[j,i]==0;
Now I am trying to convert my OPL code into python using docplex package. Sample code as follows.Here I have used 1d Decision variable just to check(purch_val)
Supplier=['q','w','e','r','t'];
n_Supplier=len(Supplier);
r_Supplier=range(n_Supplier);
na_moq_supplier=[10,20,30,40,0]
from docplex.mp.model import Model
x=Model("mymod");
purch_val=x.integer_var_list(n_Supplier,lb=0,ub=10000);
for i in r_Supplier:x.add_constraint(purch_val[i]>=na_moq_supplier[i] or purch_val[i]==0);
When I run I get an error TypeError: Cannot convert a linear constraint to boolean: x1 >= 10
It does not allow me to use or
.Could you exaplain what can I do to overcome this error.