[gecode-users] Why are my variables not constrained
Guido Tack
tack at ps.uni-sb.de
Sat Oct 4 16:44:21 CEST 2008
Hi!
This problem is going to be in the FAQ we're preparing... ;-)
When you post a constraint, only the immediate consequences are
sometimes propagated to the variables. You have to start constraint
propagation by asking the space for its status (using the status()
function). And of course even then, not all logical consequences of
the constraints are propagated to the variables, as propagation is not
complete. You have to use search in order to find actual solutions or
prove that there is none.
> branch(this, x, INT_VAR_SIZE_MIN, INT_VAL_SPLIT_MAX);
> (PS: How do i branch on a single variable (BoolVar y) and where can i
> find such information by myself)
You have to create a BoolVarArgs of size 1, let's call it bva, and set
bva[0] = b if b is the BoolVar you want to branch on. To find this
kind of information, we can currently only advise you to look at the
examples that come with Gecode, and the API documentation. In this
case, the documentation of branch tells you it needs BoolVarArgs.
Cheers,
Guido
More information about the gecode-users
mailing list