Go to the documentation of this file.
42 namespace Test {
namespace Int {
47 namespace Test {
namespace Int {
namespace Unary {
54 class ManFixPUnary :
public Test {
62 for (
int i=
p.size();
i--; )
69 :
Test(
"Unary::Man::Fix::"+
str(o)+
"::"+
str(p0)+
"::"+
str(ipl0),
70 p0.
size(),o,o+
st(p0),false,ipl0),
81 for (
int i=0;
i<
x.size();
i++)
82 for (
int j=
i+1; j<
x.size(); j++)
83 if ((
x[
i]+
p[
i] >
x[j]) && (
x[j]+
p[j] >
x[
i]))
103 for (
int i=
p.size();
i--; )
110 :
Test(
"Unary::Opt::Fix::"+
str(o)+
"::"+
str(p0)+
"::"+
str(ipl0),
111 2*p0.
size(),o,o+
st(p0),false,ipl0),
p(p0),
l(o+
st(
p)/2) {
121 int n =
x.size() / 2;
122 for (
int i=0;
i<
n;
i++)
124 for (
int j=
i+1; j<
n; j++)
126 if ((
x[
i]+
p[
i] >
x[j]) && (
x[j]+
p[j] >
x[
i]))
135 for (
int i=0;
i<
n;
i++) {
155 :
Test(
"Unary::Man::Flex::"+
str(o)+
"::"+
str(
n)+
"::"
156 +
str(minP)+
"::"+
str(maxP)+
"::"+
str(ipl0),
170 for (
int i=0;
i<
n;
i++)
171 for (
int j=
i+1; j<
n; j++)
183 for (
int i=s.size();
i--;) {
185 rel(home, s[
i]+px[
i] == e[
i]);
207 for (
int i=
p.size();
i--; )
214 :
Test(
"Unary::Opt::Flex::"+
str(o)+
"::"+
str(
n)+
"::"
215 +
str(minP)+
"::"+
str(maxP)+
"::"+
str(ipl0),
229 int n =
x.size() / 3;
230 for (
int i=0;
i<
n;
i++)
232 for (
int j=
i+1; j<
n; j++)
234 if ((
x[
i]+
x[2*
n+
i] >
x[j]) && (
x[j]+
x[2*
n+j] >
x[
i]))
247 for (
int i=
n;
i--;) {
250 rel(home, s[
i]+px[
i] == e[
i]);
255 for (
int i=0;
i<
n;
i++)
272 IntArgs p30(8, 4,0,2,9,3,7,5,0);
bool testsearch
Whether to perform search test.
ConTestLevel contest
Whether to test for certain consistency.
int off
Offset for start times.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntPropLevel ipl
Propagation level.
Generate random selection of assignments.
Help class to create and register tests.
Passing integer variables.
BoolVar expr(Home home, const BoolExpr &e, IntPropLevel ipl)
Post Boolean expression and return its value.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Gecode::IntArgs p
The processing times.
@ CTL_NONE
No consistency-test.
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual Assignment * assignment(void) const
Create and register initial assignment.
IntPropLevel
Propagation levels for integer propagators.
Test for unary constraint with optional tasks
virtual Assignment * assignment(void) const
Create and register initial assignment.
int off
Offset for start times.
int _minP
Minimum processing time.
Gecode toplevel namespace
int _maxP
Maximum processing time.
bool testfix
Whether to perform fixpoint test.
virtual Assignment * assignment(void) const
Create and register initial assignment.
Node * x
Pointer to corresponding Boolean expression node.
OptFixPUnary(const Gecode::IntArgs &p0, int o, Gecode::IntPropLevel ipl0)
Create and register test.
Test for unary constraint
Passing Boolean variables.
int l
Threshold for taking a task as optional.
Gecode::IntArgs p
The processing times.
OptFlexUnary(int n, int minP, int maxP, int o, Gecode::IntPropLevel ipl0)
Create and register test.
Test for unary constraint with optional tasks
virtual Assignment * assignment(void) const
Create and register initial assignment.
ManFlexUnary(int n, int minP, int maxP, int o, Gecode::IntPropLevel ipl0)
Create and register test.
const int max
Largest allowed integer value.
Create(void)
Perform creation and registration.
virtual bool solution(const Assignment &x) const
Test whether x is solution
int arity
Number of variables.
Base class for assignments
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
ManFixPUnary(const Gecode::IntArgs &p0, int o, Gecode::IntPropLevel ipl0)
Create and register test.
Test for unary constraint
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
static int st(const Gecode::IntArgs &p)
Get a reasonable maximal start time.
const int min
Smallest allowed integer value.
Generate random selection of assignments.
int l
Threshold for taking a task as optional.
static int st(const Gecode::IntArgs &p)
Get a reasonable maximal start time.
static int st(const Gecode::IntArgs &p)
Get a reasonable maximal start time.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
int _maxP
Maximum processing time.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
int n
Number of negative literals for node type.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Passing integer arguments.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl)
Post propagators for scheduling tasks on unary resources.
int p
Number of positive literals for node type.
int _minP
Minimum processing time.
Gecode::IntSet dom
Domain of variables.
Iterator for basic and advanced integer propagation levels.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.