57 for (
int i=p.
size();
i--; ) {
68 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
69 for (
int i=u.
size();
i--;) {
73 }
else if (u[
i] < minU2)
79 (minU > c.max()/2) || (minU2 > c.max()/2 && minU+minU2>c.max());
82 unary(home,t,s,p,icl);
90 for (
unsigned int i=u.
size();
i--;)
91 if (u[
i]>0) nonOptionals++;
97 tasks[cur++].init(s[
i],p[i],u[i]);
102 for (
int i=s.
size();
i--;)
104 tasks[cur++].init(t[
i],s[i],p[i],u[i]);
138 for (
int i=p.
size();
i--; ) {
147 if (home.
failed())
return;
149 bool allMandatory =
true;
150 for (
int i=m.
size();
i--;) {
152 allMandatory =
false;
160 for (
int i=t.
size();
i--;)
164 int nonOptionals = 0;
165 for (
unsigned int i=u.
size();
i--;)
166 if (u[
i]>0) nonOptionals++;
172 tasks[cur++].init(s[
i],p[i],u[i],m[i]);
177 for (
int i=s.
size();
i--;)
179 tasks[cur++].init(t[
i],s[i],p[i],u[i],m[i]);
211 for (
int i=p.
size();
i--; ) {
220 if (home.
failed())
return;
222 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
223 for (
int i=u.
size();
i--;) {
227 }
else if (u[
i] < minU2)
233 (minU > c.max()/2) || (minU2 > c.max()/2 && minU+minU2>c.max());
238 int nonOptionals = 0;
239 for (
unsigned int i=u.
size();
i--;)
240 if (u[
i]>0) nonOptionals++;
245 t[cur++].init(s[
i],p[i],u[i]);
275 for (
int i=p.
size();
i--; ) {
284 if (home.
failed())
return;
286 bool allMandatory =
true;
287 for (
int i=m.
size();
i--;) {
289 allMandatory =
false;
296 int nonOptionals = 0;
297 for (
unsigned int i=u.
size();
i--;)
298 if (u[
i]>0) nonOptionals++;
303 t[cur++].init(s[
i],p[i],u[i],m[i]);
334 for (
int i=p.
size();
i--; ) {
337 for (
int i=p.
size();
i--; ) {
345 if (home.
failed())
return;
348 for (
int i=p.
size();
i--;) {
356 for (
int i=p.
size();
i--;)
360 int nonOptionals = 0;
361 for (
unsigned int i=u.
size();
i--;)
362 if (u[
i]>0) nonOptionals++;
367 t[cur++].init(s[
i],p[i],e[i],u[i]);
399 for (
int i=p.
size();
i--; ) {
403 for (
int i=p.
size();
i--; ) {
411 if (home.
failed())
return;
413 bool allMandatory =
true;
414 for (
int i=m.
size();
i--;) {
416 allMandatory =
false;
423 int nonOptionals = 0;
424 for (
unsigned int i=u.
size();
i--;)
425 if (u[
i]>0) nonOptionals++;
428 for (
int i=s.
size();
i--; )
430 t[cur++].init(s[
i],p[i],e[i],u[i],m[i]);
bool failed(void) const
Check whether corresponding space is failed.
void cumulative(Home home, Cap c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntConLevel icl)
IntConLevel
Consistency levels for integer propagators.
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
int size(void) const
Return size of array (number of elements)
Argument array for primtive types.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l...
Scheduling propagator for cumulative resource with optional tasks.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Passing integer variables.
Passing integer arguments.
Passing Boolean variables.
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
Integer view for integer variables.
bool assigned(View x, int v)
Whether x is assigned to value v.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
void mul_check(long long int x, long long int y)
Throw exception if multiplication of x and y overflows.
int val(void) const
Return assigned value.
#define GECODE_ME_FAIL(me)
Check whether modification event me is failed, and fail space home.
bool assigned(void) const
Test whether view is assigned.
Scheduling propagator for cumulative resource with mandatory tasks.
Gecode toplevel namespace
Scheduling for cumulative resources
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Home class for posting propagators
Exception: Arguments are of different size
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntConLevel icl)
Post propagators for scheduling tasks on unary resources.