[gecode-users] Question about Gist

Mikael Zayenz Lagerkvist zayenz at gmail.com
Wed Oct 28 14:46:00 CET 2009


On Wed, Oct 28, 2009 at 2:36 PM, benoit <benoitlaurent at neuf.fr> wrote:
> I had a look at the files you mention as well as examples/queen-armies.cpp.
> In all these examples, the choice of the variable is performed in the status
> method. Is this always the case ?

The status function has to find out if there is anything left for the
brancher to do. The work done (scanning potentially assigned
variables) is just re-used in the choice function. Since these
examples have rather simple variable orderings, it is not required to
re-evaluate if the first variable should be the one to branch on.


> For my part, I just want to reproduce (except the recording of the last
> choice) a default branching behaviour :
> branch(*this, v, INT_VAR_SIZE_MIN, INT_VAL_MAX) ;
> I initially performed the selection of both the variable and the value in
> the choice method. Is it the proper way to achieve this or do I have to
> split each selection in the status method and in the choice method ?

You don't have to split the decision. Make sure that status returns
true or false if there is or isn't any work to do for the brancher and
that everything needed to do the commit is recorded in the choice.

Cheers,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list