40 namespace Gecode {
namespace Int {
namespace Cumulative {
51 for (
int i=0;
i<p.
size();
i++) {
62 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
63 for (
int i=0;
i<u.
size();
i++) {
67 }
else if (u[
i] < minU2)
73 (minU > c.max()/2) || (minU2 > c.max()/2 && minU+minU2>c.max());
76 unary(home,t,s,p,ipl);
85 if (u[
i]>0) nonOptionals++;
91 tasks[cur++].init(s[
i],p[i],u[i]);
98 tasks[cur++].init(t[
i],s[i],p[i],u[i]);
115 for (
int i=0;
i<p.
size();
i++) {
126 bool allMandatory =
true;
127 for (
int i=0;
i<m.
size();
i++) {
129 allMandatory =
false;
141 int nonOptionals = 0;
143 if (u[
i]>0) nonOptionals++;
149 tasks[cur++].init(s[
i],p[i],u[i],m[i]);
156 tasks[cur++].init(t[
i],s[i],p[i],u[i],m[i]);
171 for (
int i=0;
i<p.
size();
i++) {
182 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
183 for (
int i=0;
i<u.
size();
i++) {
187 }
else if (u[
i] < minU2)
193 (minU > c.max()/2) || (minU2 > c.max()/2 && minU+minU2>c.max());
198 int nonOptionals = 0;
200 if (u[
i]>0) nonOptionals++;
205 t[cur++].init(s[
i],p[i],u[i]);
220 for (
int i=0;
i<p.
size();
i++) {
231 bool allMandatory =
true;
232 for (
int i=0;
i<m.
size();
i++) {
234 allMandatory =
false;
241 int nonOptionals = 0;
243 if (u[
i]>0) nonOptionals++;
248 t[cur++].init(s[
i],p[i],u[i],m[i]);
264 for (
int i=0;
i<p.
size();
i++) {
278 for (
int i=0; i<p.
size(); i++) {
286 for (
int i=0; i<p.
size(); i++)
290 int nonOptionals = 0;
291 for (
int i=0; i<u.
size(); i++)
292 if (u[i]>0) nonOptionals++;
295 for (
int i=0; i<s.
size(); i++)
297 t[cur++].init(s[i],p[i],e[i],u[i]);
314 for (
int i=0;
i<p.
size();
i++) {
327 bool allMandatory =
true;
328 for (
int i=0; i<m.
size(); i++) {
330 allMandatory =
false;
337 int nonOptionals = 0;
338 for (
int i=0; i<u.
size(); i++)
339 if (u[i]>0) nonOptionals++;
342 for (
int i=0; i<s.
size(); i++)
344 t[cur++].init(s[i],p[i],e[i],u[i],m[i]);
ExecStatus optpost(Home home, Cap c, TaskArray< OptTask > &t, IntPropLevel ipl)
int size(void) const
Return size of array (number of elements)
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
bool assigned(void) const
Test whether view is assigned.
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l...
void cumulative(Home home, Cap c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntPropLevel ipl)
int p
Number of positive literals for node type.
Argument array for non-primitive types.
Gecode::IntArgs i({1, 2, 3, 4})
int val(void) const
Return assigned value.
ExecStatus manpost(Home home, Cap c, TaskArray< ManTask > &t, IntPropLevel ipl)
Passing integer variables.
Passing integer arguments.
Passing Boolean variables.
union Gecode::@593::NNF::@62 u
Union depending on nodetype t.
IntPropLevel
Propagation levels for integer propagators.
Integer view for integer variables.
bool assigned(View x, int v)
Whether x is assigned to value v.
void mul_check(long long int x, long long int y)
Throw exception if multiplication of x and y overflows.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
#define GECODE_ME_FAIL(me)
Check whether modification event me is failed, and fail space home.
Gecode toplevel namespace
Scheduling for cumulative resources
#define GECODE_POST
Check for failure in a constraint post function.
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, IntPropLevel ipl)
Post propagators for scheduling tasks on unary resources.