DOcplex is a pure python module, so it has a faster release cycle than Cplex Studio.
Before going further can you provide the following informations:
- what is your platform? (windows, Linux, MacOs)?
- what is your version of python? (output of `python --version`)
- what is your version of anaconda?
- what version of Cplex Studio are you using?
And finally, what is the output of the `pip freeze` command?\
You should see one line with `docplex=2.xxx` in it.
From there, I can advise a safe course of actions to upgrade DOcplex to the latest version.
Philippe.
------------------------------
Philippe Couronne
------------------------------
Original Message:
Sent: Tue September 29, 2020 12:00 PM
From: sana naz
Subject: Model problems with docplex and cplex on python
I have version 2.0 but I did not install it directly. I installed cplex studio with the academic licence. I don't know how can i upgrade that since there is no new version of cplex studio (latest I have is 12.10) and my system doesn't recognize docplex by itself in order to upgrade.
Is it OK if I install docplex again with conda and upgrade?
------------------------------
sana naz
------------------------------
Original Message:
Sent: Tue September 29, 2020 11:02 AM
From: Philippe Couronne
Subject: Model problems with docplex and cplex on python
Which version of DOcplex are you using? is it the latest version (2.15.194 of last July), if not can you update?
------------------------------
Philippe Couronne
Original Message:
Sent: Tue September 29, 2020 10:57 AM
From: sana naz
Subject: Model problems with docplex and cplex on python
Thanks , I used your code but I got this error:
AttributeError: 'CplexEngine' object has no attribute '_sync_equivalence_cts'
------------------------------
sana naz
Original Message:
Sent: Mon September 28, 2020 10:07 AM
From: Philippe Couronne
Subject: Model problems with docplex and cplex on python
Hello Sana,
Thanks for your explanations, I now understand better. If you solve directly at the "cplex" level, then some parts of the model have not been synchronized yet,
among them logical equivalences, so this might well explain your issues. I am attaching a small function, to be inserted just before calling `populate`, which should
perform this missing synchronization. This code uses undocumented methods.
The good news is, the next version of DOcplex will support solution pools directly , removing the need for these workarounds.
Let me know if this works.
Philippe.
def sync_cplex(mdl): # call this method before cplex.populate() print(f"-- synchronize cplex parameters") mdl.apply_parameters() eng = mdl.get_engine() # wrap all syncs print(f"-- synchronize variable bounds ") eng._sync_var_bounds() eng._sync_annotations(mdl) print(f"-- synchronize equivalence cts") eng._sync_equivalence_cts(mdl)
------------------------------
Philippe Couronne