45 template<
class _View,
class _Val>
51 typedef typename View::VarType
Var;
174 template<
class View,
class Val>
177 template<
class View,
class Val>
180 template<
class View,
class Val>
185 template<
class View,
class Val>
194 :
MeritBase<View,double>(home,vb), f(vb.merit()) {
201 :
MeritBase<View,double>(home,mf), f(mf.f) {
206 typename View::VarType
y(
x.
varimp());
208 return f()(home,
y,i);
227 :
MeritBase<View,unsigned int>(home,vb) {}
231 :
MeritBase<View,unsigned int>(home,md) {}
243 :
MeritBase<View,double>(home,vb), afc(vb.afc()) {}
247 :
MeritBase<View,double>(home,ma), afc(ma.afc) {}
272 :
MeritBase<View,double>(home,vb), action(vb.action()) {}
276 :
MeritBase<View,double>(home,ma), action(ma.action) {}
298 :
MeritBase<View,double>(home,vb), chb(vb.chb()) {}
302 :
MeritBase<View,double>(home,ma), chb(ma.chb) {}
Class for AFC (accumulated failure count) management.
Class for action management.
Class for CHB management.
Exception: invalid function
void dispose(Space &home)
Dispose view selection.
MeritAFC(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
double operator()(const Space &home, View x, int i)
Return AFC as merit for view x at position i.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
MeritAction(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
void dispose(Space &home)
Dispose view selection.
double operator()(const Space &home, View x, int i)
Return action as merit for view x at position i.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Action action
Action information.
Base-class for merit class.
void dispose(Space &home)
Delete view merit class.
MeritBase(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
MeritBase(Space &home, MeritBase &mb)
Constructor for cloning.
View::VarType Var
Corresponding variable type.
MeritCHB(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
void dispose(Space &home)
Dispose view selection.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
double operator()(const Space &home, View x, int i)
Return action as merit for view x at position i.
MeritDegree(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
unsigned int operator()(const Space &home, View x, int i)
Return degree as merit for view x at position i.
Merit class for user-defined merit function.
void dispose(Space &home)
Delete view merit class.
double operator()(const Space &home, View x, int i)
Return degree as merit for view x at position i.
BranchTraits< Var >::Merit Function
Corresponding merit function type.
SharedData< Function > f
The user-defined merit function.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
MeritFunction(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Class for sharing data between spaces.
Variable branching information.
unsigned int degree(void) const
Return degree (number of subscribed propagators and advisors)
VarImp * varimp(void) const
Return variable implementation of variable.
double afc(void) const
Return accumulated failure count.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar y
Post propagator for SetVar x
#define GECODE_VALID_FUNCTION(f)
Assert that a function is valid.