[gecode-users] propagator PropCond

Martin Mann qyu at gmx.de
Mon May 15 17:52:09 CEST 2006


>>> Really sure: _DOM means reexecution whenever a view changes in wahtever
>>> form. However it does not mean that for each domain change the
>>> propagator is
>>> executed once!
>> ok, I know that, but in my case it is not called anyway! mybe it's
>> because of my cost or propagate function?
> 
>>    Gecode::ExecStatus
>>    GC_Neighbored::propagate(Gecode::Space* home) {
>>      if (x0.assigned()) {
>>        GECODE_ME_CHECK(removeNonNeighbors(home,x1,x0.val()));
>>      }else if (x1.assigned()) {
>>        GECODE_ME_CHECK(removeNonNeighbors(home,x0,x1.val()));
>>      } else {
>>        GECODE_ME_CHECK(removeNonNeighbors(home));
>>      }
>>      return Gecode::ES_SUBSUMED;
>>    }
> 
> This propagator will be called at most once. ES_SUBSUMED means that this
> propagator won't contribute any more. The propagator will be called once
> when it's posted (as every propagator is called then, except for those
> that are subscribed to VAL), and then it disappears.
> What you probably want to return is ES_FIX or ES_NONFIX, depending on
> whether your propagator computes a fixpoint or not.

You are right... I m blind! The only position I ve not checked befor 
posting my problem..

Thanks for the final hint!

But I m a bit confused. My internal propagation functions 
"removeNonNeighbors" returns the ModEvents

- ME_GEN_FAILED (caught by the macro Gecode_ME_CHECK)
- ME_GEN_ASSIGNED (if both variables are assigned and fullfill my 
constraint)
- ME_GEN_NONE (if nothing changed via propagation
- ME_GEN_DOM (if on of the domain is changed)

in the case of ME_GEN_ASSIGNED the propagator is done and dont have to 
be recalled in this branch... ES_SUBSUMED should be the right return 
choice isnt it? or is ES_FIX my choice and a solution corresponds with a 
fixpoint at that point?

in the two remaining cases something else should be thrown but I m not 
sure what! ES_OK? ES_NOFIX???

Thank you

Martin





More information about the gecode-users mailing list