Base-class for propagators. More...
#include <core.hpp>
Protected Member Functions | |
Propagator (Home home) | |
Constructor for posting. | |
Propagator (Space &home, bool share, Propagator &p) | |
Constructor for cloning p. | |
Propagation | |
virtual ExecStatus | propagate (Space &home, const ModEventDelta &med)=0 |
Propagation function. | |
virtual PropCost | cost (const Space &home, const ModEventDelta &med) const =0 |
Cost function. | |
ModEventDelta | modeventdelta (void) const |
Return the modification event delta. | |
virtual ExecStatus | advise (Space &home, Advisor &a, const Delta &d) |
Advise function. | |
Information | |
double | afc (void) const |
Return the accumlated failure count. |
Base-class for propagators.
Gecode::Propagator::Propagator | ( | Home | home | ) | [inline, protected] |
Gecode::Propagator::Propagator | ( | Space & | home, |
bool | share, | ||
Propagator & | p | ||
) | [inline, protected] |
virtual ExecStatus Gecode::Propagator::propagate | ( | Space & | home, |
const ModEventDelta & | med | ||
) | [pure virtual] |
Propagation function.
The propagation function must return an execution status as follows:
Apart from the above values, a propagator can return the result from calling one of the functions defined by a space:
Implemented in Gecode::Int::Rel::LexNq, Gecode::Int::Rel::LexLqLe, Gecode::Int::Bool::Clause, Gecode::Set::Int::Weights, Gecode::Set::Int::ChannelInt, Gecode::Set::Int::Match, Gecode::Int::GCC::Dom, Gecode::Set::Rel::ReLq, Gecode::Int::Extensional::LayeredGraph, Gecode::Set::Element::ElementDisjoint, Gecode::Int::GCC::Bnd, Gecode::Set::Rel::ReEq, Gecode::Int::Element::Int, Gecode::Set::Element::ElementUnionConst, Gecode::Int::BinPacking::Pack, Gecode::Int::Distinct::Bnd, Gecode::Set::Element::ElementUnion, Gecode::Set::Rel::ReSubset, Gecode::Int::Sequence::Sequence, Gecode::Int::Cumulatives::Val, Gecode::Set::Element::ElementIntersection, Gecode::Kernel::NaryWait, Gecode::Int::Sorted::Sorted, Gecode::Int::GCC::Val, and Gecode::Kernel::UnaryWait.
virtual PropCost Gecode::Propagator::cost | ( | const Space & | home, |
const ModEventDelta & | med | ||
) | const [pure virtual] |
Cost function.
Implemented in Gecode::Int::Linear::LinBoolScale, Gecode::Int::Linear::LinBoolView, Gecode::Int::Linear::ReLinBoolInt, Gecode::Int::Linear::LinBoolInt, Gecode::Int::Rel::LexNq, Gecode::Int::Rel::LexLqLe, Gecode::Int::Bool::Clause, Gecode::Int::Linear::Lin, Gecode::Set::Int::Weights, Gecode::Int::TaskProp, Gecode::Int::Linear::LinTer, Gecode::Set::Int::ChannelInt, Gecode::Int::NValues::BoolBase, Gecode::Int::Count::ViewBase, Gecode::MixNaryOnePropagator, Gecode::Set::Int::Match, Gecode::Int::Element::View, Gecode::Int::Extensional::Base, Gecode::MixTernaryPropagator, Gecode::Int::NoOverlap::Base, Gecode::Int::GCC::Dom, Gecode::Set::Rel::ReLq, Gecode::MixBinaryPropagator, Gecode::Int::Extensional::LayeredGraph, Gecode::Set::Element::ElementDisjoint, Gecode::Int::GCC::Bnd, Gecode::NaryOnePropagator, Gecode::Int::Element::Int, Gecode::Set::Rel::ReEq, Gecode::Int::BinPacking::Pack, Gecode::Set::Element::ElementUnionConst, Gecode::NaryPropagator, Gecode::Int::Count::IntBase, Gecode::Int::Distinct::Bnd, Gecode::Int::ReMixBinaryPropagator, Gecode::Set::Element::ElementUnion, Gecode::Set::Rel::ReSubset, Gecode::TernaryPropagator, Gecode::Int::Sequence::Sequence, Gecode::Int::Linear::ReLinBin, Gecode::Int::Cumulatives::Val, Gecode::Int::ReBinaryPropagator, Gecode::BinaryPropagator, Gecode::Kernel::NaryWait, Gecode::Set::Element::ElementIntersection, Gecode::Int::Bool::BoolTernary, Gecode::Int::Sorted::Sorted, Gecode::Int::Linear::LinBin, Gecode::Int::GCC::Val, Gecode::Int::Channel::Base, Gecode::Int::ReUnaryPropagator, Gecode::Int::Bool::BoolBinary, Gecode::UnaryPropagator, and Gecode::Kernel::UnaryWait.
ModEventDelta Gecode::Propagator::modeventdelta | ( | void | ) | const [inline] |
ExecStatus Gecode::Propagator::advise | ( | Space & | home, |
Advisor & | a, | ||
const Delta & | d | ||
) | [virtual] |
Advise function.
The advisor is passed as argument a.
A propagator must specialize this advise function, if it uses advisors. The advise function must return an execution status as follows:
Apart from the above values, an advisor can return the result from calling the function defined by a space:
The delta d describes how the variable has been changed by an operation on the advisor's variable. Typically, the delta information can only be utilized by either static or member functions of views as the actual delta information is both domain and view dependent.
Reimplemented in Gecode::Int::Bool::Clause, Gecode::Int::NValues::BoolBase, Gecode::Int::Extensional::LayeredGraph, and Gecode::Int::Sequence::Sequence.
double Gecode::Propagator::afc | ( | void | ) | const [inline] |
size_t Gecode::Propagator::size |