Hi!
I've been looking into this documentation page: Logical constraints for CPLEX
I am trying to move away from using linear rules/constraints for my model. Based on the information from this page, it is possible to add the constraints in the logical format rather than linear. For example, I want to do something like the following:
variables = ["A", "B", "C", "D"]
mdl1 = Model(name='test_model')
for var in variables:
mdl1.binary_var(name=var)
mdl1.add(eval("(mdl1.get_var_by_name('A') | mdl1.get_var_by_name('B')) & (mdl1.get_var_by_name('C') | mdl1.get_var_by_name('D'))"))
However, seems like this is not a valid option due to syntax and formatting errors and the symbols from the previously mentioned documentation do not seem to work.
What am I doing incorrectly?
How can I add logic rules? Could you give the example of how to add a rule: A => -(C & B) | D ?
Which format does the CPLEX expect and is using non-linear rules possible?
Thank you and best regards,
Mariia
------------------------------
Mariia Bogdanova
------------------------------