How to Change from Gecode 2.2.2 to Gecode 3.0.0
As Gecode 3.0.0 is a major revision, your programs that are written for Gecode 2.2.2 are likely to require some modifications before they work again. All modifications are straightforward, though.This short summary shows how to adapt your models, for changes to propagator implementations, etc, please consult the changelog.
Passing parameters
Now everything is passed as reference (Space, Propagator, ModEventDelta, Advisor, Branching, and BranchingDesc).The reason for this massive change is to be more C++ compliant and make the interfaces more consistent (at some places things were passed as references and at other places as pointers, for no obvious and explainable reason). Routines that create objects rather than pass them (such as copy, clone, or description) still return a pointer to an object (so that it can actually be deleted!).
You will have to rewrite your models and other programs using Gecode. For models this is easy enough:
- Replace "(Space* home" by "(Space& home".
- Replace "home->" by "home.".
- Replace "(this" by "(*this".
For the other changes, just lookout for the changes in types and that "this" becomes "*this" now.
Set constrains
Element and convexity constraints on set variables have a more uniform interface, and the match constrained has been renamed to channel.The values for variable and value selection for branching have been made consistent and extended. The following values have been renamed:
- SET_VAR_MIN_CARD -> SET_VAR_SIZE_MIN
- SET_VAR_MAX_CARD -> SET_VAR_SIZE_MAX
- SET_VAR_MIN_UNKNOWN_ELEM -> SET_VAR_MIN_MIN
- SET_VAR_MAX_UNKNOWN_ELEM -> SET_VAR_MAX_MAX
- SET_VAL_MIN -> SET_VAL_MIN_INC
- SET_VAL_MAX -> SET_VAL_MAX_INC
