42 namespace Test {
namespace Int {
60 :
Test(
"Wait::Int::"+
str(n)+
"::"+
61 (sf0 ?
"std::function" :
"funptr"),n,0,n,false), sf(sf0) {}
65 for (
int j=
i+1; j<x.
size(); j++)
73 auto f =
static_cast<std::function<void(Space&)>
> 74 ([](
Space& home) {
c(home); });
91 for (
int j=
i+1; j<home.
x.
size(); j++)
92 if (home.
x[
i].val() == home.
x[j].val())
105 :
Test(
"Wait::Bool::"+
str(n)+
"::"+
106 (sf0 ?
"std::function" :
"funptr"),n,0,1,false), sf(sf0) {}
118 for (
int i=
b.size();
i--; )
120 auto f =
static_cast<std::function<void(Space&)>
> 121 ([](
Space& home) {
c(home); });
139 t += home.
x[
i].val();
154 (sf0 ?
"std::function" :
"funptr"),1,0,1,false), sf(sf0) {}
163 auto sft =
static_cast<std::function<void(Space&)>
> 164 ([](
Space& home) {
t(home); });
165 auto sfe =
static_cast<std::function<void(Space&)>
> 166 ([](
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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
void fail(void)
Fail space.
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.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
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.