42 namespace Test {
namespace Int {
60 for (
int i=p.
size();
i--; )
67 :
Test(
"Unary::Man::Fix::"+
str(o)+
"::"+
str(p0),
80 for (
int j=
i+1; j<x.
size(); j++)
81 if ((x[
i]+p[
i] > x[j]) && (x[j]+p[j] > x[
i]))
101 for (
int i=p.
size();
i--; )
108 :
Test(
"Unary::Opt::Fix::"+
str(o)+
"::"+
str(p0),
109 2*p0.
size(),o,o+
st(p0)), p(p0), l(o+
st(p)/2) {
119 int n = x.
size() / 2;
120 for (
int i=0;
i<
n;
i++)
122 for (
int j=
i+1; j<
n; j++)
124 if ((x[
i]+p[
i] > x[j]) && (x[j]+p[j] > x[
i]))
133 for (
int i=0;
i<
n;
i++) {
154 :
Test(
"Unary::Man::Flex::"+
str(o)+
"::"+
str(n)+
"::"
155 +
str(minP)+
"::"+
str(maxP),
156 2*n,0,n*maxP), _minP(minP), _maxP(maxP), off(o) {
169 for (
int i=0;
i<
n;
i++)
170 for (
int j=
i+1; j<
n; j++)
171 if ((x[
i]+x[n+
i] > x[j]) && (x[j]+x[n+j] > x[
i]))
182 for (
int i=s.
size();
i--;) {
183 s[
i] =
expr(home, off+x[
i]);
184 rel(home, s[i]+px[i] == e[i]);
185 rel(home, _minP <= px[i]);
186 rel(home, _maxP >= px[i]);
206 for (
int i=p.
size();
i--; )
213 :
Test(
"Unary::Opt::Flex::"+
str(o)+
"::"+
str(n)+
"::"
214 +
str(minP)+
"::"+
str(maxP),
215 3*n,0,n*maxP), _minP(minP), _maxP(maxP), off(o),
228 int n = x.
size() / 3;
229 for (
int i=0;
i<
n;
i++)
231 for (
int j=
i+1; j<
n; j++)
233 if ((x[
i]+x[2*n+
i] > x[j]) && (x[j]+x[2*n+j] > x[
i]))
246 for (
int i=n;
i--;) {
247 s[
i] =
expr(home, off+x[
i]);
249 rel(home, s[i]+px[i] == e[i]);
250 rel(home, _minP <= px[i]);
251 rel(home, _maxP >= px[i]);
254 for (
int i=0;
i<
n;
i++)
265 ManFlexUnary
mflu10(4,0,2,0);
269 OptFlexUnary
oflu10(4,0,2,0);
287 ManFlexUnary
mflu20(4,3,5,0);
289 OptFlexUnary
oflu20(4,3,5,0);
307 ManFlexUnary
mflu30(6,2,7,0);
309 OptFlexUnary
oflu30(6,2,7,0);
int off
Offset for start times.
ManFlexUnary mflu01i(5, 0, 2, Gecode::Int::Limits::min)
ManFixPUnary mfu10(p1, 0)
int _minP
Minimum processing time.
ManFlexUnary mflu030(8, 0, 9, 0)
ManFixPUnary mfu20(p2, 0)
virtual Assignment * assignment(void) const
Create and register initial assignment.
ManFlexUnary mflu010(5, 0, 2, 0)
OptFixPUnary ofu20(p2, 0)
ManFlexUnary mflu30(6, 2, 7, 0)
Gecode::IntArgs p30(8, 4, 0, 2, 9, 3, 7, 5, 0)
Test for unary constraint
int size(void) const
Return size of array (number of elements)
ManFlexUnary mflu02i(6, 0, 5, Gecode::Int::Limits::min)
int _maxP
Maximum processing time.
ManFlexUnary mflu020(6, 0, 5, 0)
ManFlexUnary mflu03i(8, 0, 9, Gecode::Int::Limits::min)
OptFlexUnary oflu2i(4, 3, 5, Gecode::Int::Limits::min)
ManFixPUnary mfu01i(p10, Gecode::Int::Limits::min)
Gecode::IntSet dom
Domain of variables.
int l
Thereshold for taking a task as optional.
int _minP
Minimum processing time.
ManFlexUnary mflu2i(4, 3, 5, Gecode::Int::Limits::min)
OptFlexUnary oflu02i(6, 0, 5, Gecode::Int::Limits::min)
int _maxP
Maximum processing time.
ManFixPUnary mfu020(p20, 0)
OptFlexUnary oflu01i(5, 0, 2, Gecode::Int::Limits::min)
ConTestLevel contest
Whether to test for certain consistency.
const int max
Largest allowed integer value.
ManFlexUnary mflu10(4, 0, 2, 0)
ManFixPUnary mfu3i(p3, Gecode::Int::Limits::min)
Generate random selection of assignments.
ManFlexUnary(int n, int minP, int maxP, int o)
Create and register test.
ManFlexUnary mflu3i(6, 2, 7, Gecode::Int::Limits::min)
const int min
Smallest allowed integer value.
OptFlexUnary oflu030(8, 0, 9, 0)
ManFixPUnary mfu2i(p2, Gecode::Int::Limits::min)
ManFlexUnary mflu1i1(4, 1, 3, Gecode::Int::Limits::min)
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
ManFixPUnary(const Gecode::IntArgs &p0, int o)
Create and register test.
virtual Assignment * assignment(void) const
Create and register initial assignment.
int p
Number of positive literals for node type.
OptFixPUnary ofu02i(p20, Gecode::Int::Limits::min)
OptFlexUnary oflu020(6, 0, 5, 0)
Gecode::IntArgs p2(4, 4, 3, 3, 5)
OptFlexUnary oflu3i(6, 2, 7, Gecode::Int::Limits::min)
Test for unary constraint
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
OptFixPUnary ofu10(p1, 0)
OptFixPUnary ofu03i(p30, Gecode::Int::Limits::min)
Generate random selection of assignments.
OptFlexUnary oflu10(4, 0, 2, 0)
Test for unary constraint with optional tasks
int l
Thereshold for taking a task as optional.
OptFixPUnary ofu3i(p3, Gecode::Int::Limits::min)
OptFlexUnary oflu1i(4, 0, 2, Gecode::Int::Limits::min)
ManFlexUnary mflu20(4, 3, 5, 0)
unsigned int size(I &i)
Size of all ranges of range iterator i.
ManFlexUnary mflu101(4, 1, 3, 0)
OptFixPUnary ofu1i(p1, Gecode::Int::Limits::min)
static int st(const Gecode::IntArgs &p)
Get a reasonable maximal start time.
virtual Assignment * assignment(void) const
Create and register initial assignment.
ManFixPUnary mfu30(p3, 0)
ArrayTraits< VarArgArray< Var > >::ArgsType slice(int start, int inc=1, int n=-1)
int off
Offset for start times.
Gecode::IntArgs p
The processing times.
OptFixPUnary ofu30(p3, 0)
Passing integer variables.
Passing integer arguments.
Passing Boolean variables.
ManFlexUnary mflu1i(4, 0, 2, Gecode::Int::Limits::min)
OptFixPUnary ofu020(p20, 0)
bool testfix
Whether to perform fixpoint test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
OptFlexUnary oflu03i(8, 0, 9, Gecode::Int::Limits::min)
OptFixPUnary ofu030(p30, 0)
BoolVar expr(Home home, const BoolExpr &e, IntConLevel icl)
Post Boolean expression and return its value.
OptFixPUnary ofu2i(p2, Gecode::Int::Limits::min)
Node * x
Pointer to corresponding Boolean expression node.
Gecode::IntArgs p20(6, 4, 0, 3, 3, 0, 5)
bool testsearch
Whether to perform search test.
OptFlexUnary(int n, int minP, int maxP, int o)
Create and register test.
Test for unary constraint with optional tasks
OptFixPUnary ofu01i(p10, Gecode::Int::Limits::min)
Base class for assignments
ManFixPUnary mfu030(p30, 0)
OptFlexUnary oflu010(5, 0, 2, 0)
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
OptFlexUnary oflu30(6, 2, 7, 0)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
static int st(const Gecode::IntArgs &p)
Get a reasonable maximal start time.
OptFixPUnary(const Gecode::IntArgs &p0, int o)
Create and register test.
OptFixPUnary ofu010(p10, 0)
ManFixPUnary mfu03i(p30, Gecode::Int::Limits::min)
virtual Assignment * assignment(void) const
Create and register initial assignment.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntArgs p
The processing times.
ManFixPUnary mfu1i(p1, Gecode::Int::Limits::min)
OptFlexUnary oflu20(4, 3, 5, 0)
ManFixPUnary mfu010(p10, 0)
int arity
Number of variables.
Gecode::IntArgs p3(6, 4, 2, 9, 3, 7, 5)
static int st(const Gecode::IntArgs &p)
Get a reasonable maximal start time.
ManFixPUnary mfu02i(p20, Gecode::Int::Limits::min)
int size(void) const
Return size of array (number of elements)
Gecode::IntArgs p1(4, 2, 2, 2, 2)
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
int size(void) const
Return number of variables.
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntConLevel icl)
Post propagators for scheduling tasks on unary resources.
Gecode::IntArgs p10(5, 2, 2, 0, 2, 2)
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.