Originally posted by: alvarolorca
Hi,
I am trying to copy an instance of cplex, not by reference, in Python.
That is, I create an instance of cplex with "cpx1 = cplex.Cplex()", then I add lots of variables and constraints, but then I want to create a copy of it, that is, I do "cpx2 = cpx1", and want to add variables and constraints to cpx2 without changing cpx1, however, Python created cpx2 as a reference to cpx1 and I haven't found a way to avoid that. I want to do stuff with cpx2 and different stuff with cpx1, but create cpx2 at some point in the middle as an exact copy of cpx1.
(I know I could simply create cpx2 in the exact same way I created cpx1, but in my case that will take too long so I want to avoid that.)
Thank you,
Alvaro
#CPLEXOptimizers#DecisionOptimization