38 namespace Test {
namespace Int {
56 :
Test(
"Wait::Int::"+
str(n)+
"::"+
57 (sf0 ?
"std::function" :
"funptr"),n,0,n,false), sf(sf0) {}
61 for (
int j=
i+1; j<x.
size(); j++)
69 auto f =
static_cast<std::function<void(Space&)>
> 70 ([](
Space& home) {
c(home); });
87 for (
int j=
i+1; j<home.
x.
size(); j++)
88 if (home.
x[
i].val() == home.
x[j].val())
101 :
Test(
"Wait::Bool::"+
str(n)+
"::"+
102 (sf0 ?
"std::function" :
"funptr"),n,0,1,false), sf(sf0) {}
114 for (
int i=
b.size();
i--; )
116 auto f =
static_cast<std::function<void(Space&)>
> 117 ([](
Space& home) {
c(home); });
135 t += home.
x[
i].val();
150 (sf0 ?
"std::function" :
"funptr"),1,0,1,false), sf(sf0) {}
159 auto sft =
static_cast<std::function<void(Space&)>
> 160 ([](
Space& home) {
t(home); });
161 auto sfe =
static_cast<std::function<void(Space&)>
> 162 ([](
Space& home) { e(home); });
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Gecode::IntVarArray x
Variables to be tested.
bool sf
Whether to use std::function.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Simple test for wait (Boolean variables)
int size(void) const
Return size of array (number of elements)
int size(void) const
Return number of variables.
bool sf
Whether to use std::function.
Space for executing tests.
IntWait(int n, bool sf0)
Create and register test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
void when(Home home, BoolVar x, std::function< void(Space &home)> t, IntPropLevel)
Execute t (then) when x is assigned one.
int n
Number of negative literals for node type.
Gecode::IntArgs i({1, 2, 3, 4})
void fail(void)
Fail space.
struct Gecode::@593::NNF::@62::@63 b
For binary nodes (and, or, eqv)
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
When(bool sf0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post wait on x.
Simple test for wait (integer variables)
static void e(Gecode::Space &home)
Else-function to be executed.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post when on x.
Passing Boolean variables.
static void t(Gecode::Space &home)
Then-function to be executed.
Node * x
Pointer to corresponding Boolean expression node.
BoolWait(int n, bool sf0)
Create and register test.
Base class for assignments
bool sf
Whether to use std::function.
Gecode toplevel namespace
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post wait on x.
static void c(Gecode::Space &_home)
Continuation to be executed.
static void c(Gecode::Space &_home)
Continuation to be executed.