Originally posted by: ol
Hello,
1/ the propagation between 2 different models cannot be shared, if you change the model with your parameters, the propagation on the model before the change may be invalid for the model after the change since a constraint that may have reduced some domains may have been removed.
You could share propagation only if you can only add constraints by your parameters modification, in this case, you should estimate if the gain in performance is worth the complexity of writing a goal to handle the parameters.
2/ you do not need to call the function propagate() before startNewSearch(). This is already done at the root node of the search, and then this is maintained incrementally during the search.
Furthermore, propagate(constraint) do not add the constraint to the model, and do not keep the domain reductions. You need to call model.add(constraint).
3/ You said "in CP Optimizer I cannot modify the variable directly"
You can change the domain of the variable when declaring it.
Or you can add a constraint to the model: model.add(x <= 5);
But propagate(x<=5); will NOT do what you mean, it will not constraint x <=5 for the following search.
Regards,
ol
#CPOptimizer#DecisionOptimization