51 using namespace Gecode::Int;
52 using namespace Gecode::Int::Cumulative;
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--;) {
72 else if (u[
i] < minU2)
78 (minU > c.max()/2) || (minU2 > c.max()/2 && minU+minU2>c.max());
81 unary(home,t,s,p,icl);
91 tasks[
i].init(s[
i],p[i],u[i]);
96 tasks[
i].init(t[
i],s[i],p[i],u[i]);
124 using namespace Gecode::Int;
125 using namespace Gecode::Int::Cumulative;
130 for (
int i=p.
size();
i--; ) {
139 if (home.
failed())
return;
141 bool allMandatory =
true;
142 for (
int i=m.
size();
i--;) {
144 allMandatory =
false;
152 for (
int i=t.
size();
i--;)
159 tasks[
i].init(s[
i],p[i],u[i],m[i]);
163 for (
int i=s.
size();
i--;)
164 tasks[
i].init(t[
i],s[i],p[i],u[i],m[i]);
191 using namespace Gecode::Int;
192 using namespace Gecode::Int::Cumulative;
196 for (
int i=p.
size();
i--; ) {
205 if (home.
failed())
return;
207 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
208 for (
int i=u.
size();
i--;) {
211 else if (u[
i] < minU2)
217 (minU > c.max()/2) || (minU2 > c.max()/2 && minU+minU2>c.max());
223 for (
int i=0;
i<s.
size();
i++) {
224 t[
i].init(s[
i],p[i],u[i]);
249 using namespace Gecode::Int;
250 using namespace Gecode::Int::Cumulative;
255 for (
int i=p.
size();
i--; ) {
264 if (home.
failed())
return;
266 bool allMandatory =
true;
267 for (
int i=m.
size();
i--;) {
269 allMandatory =
false;
277 for (
int i=0;
i<s.
size();
i++) {
278 t[
i].init(s[
i],p[i],u[i],m[i]);
304 using namespace Gecode::Int;
305 using namespace Gecode::Int::Cumulative;
310 for (
int i=p.
size();
i--; ) {
313 for (
int i=p.
size();
i--; ) {
321 if (home.
failed())
return;
324 for (
int i=p.
size();
i--;) {
332 for (
int i=p.
size();
i--;)
337 for (
int i=s.
size();
i--; )
338 t[
i].init(s[
i],p[i],e[i],u[i]);
365 using namespace Gecode::Int;
366 using namespace Gecode::Int::Cumulative;
370 for (
int i=p.
size();
i--; ) {
374 for (
int i=p.
size();
i--; ) {
382 if (home.
failed())
return;
384 bool allMandatory =
true;
385 for (
int i=m.
size();
i--;) {
387 allMandatory =
false;
395 for (
int i=s.
size();
i--; )
396 t[
i].init(s[
i],p[i],e[i],u[i],m[i]);