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);
79 for (
int i=0; i<t.
size(); i++)
84 for (
int i=0; i<u.
size(); i++)
85 if (u[i]>0) nonOptionals++;
89 for (
int i=0; i<s.
size(); i++)
91 tasks[cur++].init(s[i],p[i],u[i]);
96 for (
int i=0; i<s.
size(); 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;
137 for (
int i=0; i<t.
size(); i++)
141 int nonOptionals = 0;
142 for (
int i=0; i<u.
size(); i++)
143 if (u[i]>0) nonOptionals++;
147 for (
int i=0; i<s.
size(); i++)
149 tasks[cur++].init(s[i],p[i],u[i],m[i]);
154 for (
int i=0; i<s.
size(); 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;
199 for (
int i=0; i<u.
size(); i++)
200 if (u[i]>0) nonOptionals++;
203 for (
int i=0; i<s.
size(); i++)
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;
242 for (
int i=0; i<u.
size(); i++)
243 if (u[i]>0) nonOptionals++;
246 for (
int i=0; i<s.
size(); i++)
248 t[cur++].init(s[i],p[i],u[i],m[i]);
264 for (
int i=0; i<p.
size(); i++) {
274 for (
int i=0; i<p.
size(); i++)
278 for (
int i=0; i<p.
size(); i++) {
279 if (!p[i].assigned()) {
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++) {
324 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]);
int size(void) const
Return size of array (number of elements)
Passing Boolean variables.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
Home class for posting propagators
Passing integer arguments.
Passing integer variables.
Exception: Arguments are of different size
Integer view for integer variables.
#define GECODE_POST
Check for failure in a constraint post function.
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
#define GECODE_ME_FAIL(me)
Check whether modification event me is failed, and fail space home.
IntPropLevel
Propagation levels for integer propagators.
ArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Scheduling for cumulative resources
ExecStatus optpost(Home home, Cap c, TaskArray< OptTask > &t, IntPropLevel ipl)
ExecStatus manpost(Home home, Cap c, TaskArray< ManTask > &t, IntPropLevel ipl)
void mul_check(long long int x, long long int y)
Throw exception if multiplication of x and y overflows.
void cumulative(Home home, Cap c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntPropLevel ipl)
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l.
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Gecode toplevel namespace
void cumulative(Home home, int c, const TaskTypeArgs &t, const IntVarArgs &flex, const IntArgs &fix, const IntArgs &u, IntPropLevel ipl=IPL_DEF)
Post propagators for scheduling tasks on cumulative resources.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl=IPL_DEF)
Post propagators for scheduling tasks on unary resources.