53 const Val&
val(
void)
const;
60 template<
class View,
class Val, PropCond pc>
89 template<
class View,
int n,
class Val,
unsigned int a,
90 class Filter,
class Print>
97 typedef typename View::VarType
Var;
128 std::ostream& o)
const;
143 template<
class View,
int n,
class Val,
unsigned int a>
160 const Pos& p,
const Val& n)
181 template<
class View,
class Val, PropCond pc>
184 :
NGL(home),
x(x0),
n(n0) {}
186 template<
class View,
class Val, PropCond pc>
189 :
NGL(home,ngl),
n(ngl.
n) {
190 x.update(home,ngl.
x);
193 template<
class View,
class Val, PropCond pc>
196 x.subscribe(home,p,pc);
199 template<
class View,
class Val, PropCond pc>
205 template<
class View,
class Val, PropCond pc>
208 x.reschedule(home,p,pc);
211 template<
class View,
class Val, PropCond pc>
215 return sizeof(*this);
224 template<
class View,
int n,
class Val,
unsigned int a,
225 class Filter,
class Print>
235 if (
vsc->notice() ||
f.notice() ||
p.notice())
239 template<
class View,
int n,
class Val,
unsigned int a,
240 class Filter,
class Print>
251 template<
class View,
int n,
class Val,
unsigned int a,
252 class Filter,
class Print>
258 vsc(b.vsc->copy(home)), p(b.p) {}
260 template<
class View,
int n,
class Val,
unsigned int a,
261 class Filter,
class Print>
268 template<
class View,
int n,
class Val,
unsigned int a,
269 class Filter,
class Print>
277 template<
class View,
int n,
class Val,
unsigned int a,
278 class Filter,
class Print>
288 template<
class View,
int n,
class Val,
unsigned int a,
289 class Filter,
class Print>
302 template<
class View,
int n,
class Val,
unsigned int a,
303 class Filter,
class Print>
309 return vsc->ngl(home,b,
313 template<
class View,
int n,
class Val,
unsigned int a,
314 class Filter,
class Print>
318 std::ostream& o)
const {
328 template<
class View,
int n,
class Val,
unsigned int a,
329 class Filter,
class Print>
332 if (
vsc->notice() ||
f.notice() ||
p.notice())
339 template<
class View,
int n,
class Val,
unsigned int a>
Base-class for both propagators and branchers.
Class storing a branch filter function.
Class withot a branch filter function.
Class without print function.
Class storing a print function.
Base-class for branchers.
Choice for performing commit
Home class for posting propagators
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
No-good literal recorded during search.
NGL(void)
Constructor for creation.
virtual size_t dispose(Space &home)
Dispose.
virtual void archive(Archive &e) const
Archive into e.
const Pos & pos(void) const
Return position in array.
PosChoice(const PosChoice &c)
Initialize.
Choice storing position and value
const Val & val(void) const
virtual void archive(Archive &e) const
Archive into e.
PosValChoice(const Brancher &b, unsigned int a, const Pos &p, const Val &n)
Initialize choice for brancher b, number of alternatives a, position p, and value n.
const int pos
Position of view.
Base-class for propagators.
Generic brancher by view selection.
Pos pos(Space &home)
Return position information.
ViewArray< View > x
Views to branch on.
ViewBrancher(Space &home, ViewBrancher< View, Filter, n > &b)
Constructor for cloning b.
View view(const Pos &p) const
Return view according to position information p.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
ViewSel< View > * vs[n]
View selection objects.
Abstract class for view selection.
Generic brancher by view and value selection.
virtual void print(const Space &home, const Choice &c, unsigned int b, std::ostream &o) const
Print branch for choice c and alternative b.
virtual Actor * copy(Space &home)
Perform cloning.
virtual NGL * ngl(Space &home, const Choice &c, unsigned int b) const
Create no-good literal for choice c and alternative b.
static void post(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, BranchFilter< Var > bf, VarValPrint< Var, Val > vvp)
Brancher post function.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
virtual const Choice * choice(Space &home)
Return choice.
View::VarType Var
The corresponding variable.
ViewValBrancher(Space &home, ViewValBrancher &b)
Constructor for cloning b.
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
virtual void reschedule(Space &home, Propagator &p)
Schedule propagator p.
virtual void cancel(Space &home, Propagator &p)
Cancel subscription for no-good literal.
ViewValNGL(Space &home, View x, Val n)
Initialize for propagator p with view x and value n.
virtual size_t dispose(Space &home)
Dispose.
virtual void subscribe(Space &home, Propagator &p)
Create subscription for no-good literal.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
@ AP_DISPOSE
Actor must always be disposed.
Gecode toplevel namespace
std::function< void(const Space &home, const Brancher &b, unsigned int a, Var x, int i, const Val &m, std::ostream &o)> VarValPrint
Function type for printing variable and value selection.
void postviewvalbrancher(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, BranchFilter< typename View::VarType > bf, VarValPrint< typename View::VarType, Val > vvp)
Post view value brancher.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
@ ES_OK
Execution is okay.
@ ES_FAILED
Execution has resulted in failure.
Post propagator for SetVar x
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
#define GECODE_VTABLE_EXPORT