I am using the CP Optimizer Java API to model an optimization problem. I have created a model using IloCP cp = new IloCP() and added intervals and constraints to this model. I am interested in making a copy or clone this model but fail at every attempt I make. Should I use IloCP copy_cp = new IloCP(cp) or create an empty model IloCP copy_cp = new IloCP() and use some function to get all the information from my original model to this model? In the first case, I notice that constraints that I add to my original model after making the copy also affects my copy.
I'm aim for adding extra conditions to my copy and solving both the original and copied/cloned model and compare the resulting schedules.
Thanks in advance,