[gecode-users] Indexing into arrays

Milt aemhm1 at hotmail.com
Mon Nov 21 16:10:34 CET 2011


Thanks Christian,

> ...failing a space does not
> stop execution of a space's method (or with other words, does not throw a
> C++ exception or something like that). The reason for that is that it does
> not matter! The code defining the variables, constraints, and propagators is
> executed just once initially in order to create the space for the root node
> of the search tree. This is cheap. What takes time is doing constraint
> propagation (triggered by status()) and this is terminated immediately when
> failure occurs.

Good...so Gecode is right to keep going after failing the root node because it 
has to finish setting up the model infrastructure once (to post all of the 
constraints), but it's very efficient beyond the root node.  I'll read further 
in the branch and search sections of MPG to better understand how and in what 
order everything executes...that seems to be where I'm fuzziest right now.

> I am not sure I understand your second point. After running status() you
> should always check whether a space is failed (status() returns that
> information). So, when testing why not run status() everytime to make sure
> that things are not yet failed?

Ok, so I can check for the result from status() e.g., SS_FAILED, rather than 
just running status() to force propagation. I just read some more of MPG 
chapter 20 and see there's also ES_FAILED which can be used to determine which 
propagator failed.

I'll give that a shot.
Thanks for your help!
-Milt




More information about the users mailing list