40 namespace Gecode {
namespace Int {
namespace Cumulative {
51 for (
int i=p.
size();
i--; ) {
62 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
63 for (
int 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=p.
size();
i--; ) {
126 bool allMandatory =
true;
127 for (
int i=m.
size();
i--;) {
129 allMandatory =
false;
137 for (
int i=t.
size();
i--;)
141 int nonOptionals = 0;
142 for (
int i=u.
size();
i--;)
143 if (u[
i]>0) nonOptionals++;
149 tasks[cur++].init(s[
i],p[i],u[i],m[i]);
154 for (
int i=s.
size();
i--;)
156 tasks[cur++].init(t[
i],s[i],p[i],u[i],m[i]);
171 for (
int i=p.
size();
i--; ) {
182 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
183 for (
int 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=u.
size();
i--;)
200 if (u[
i]>0) nonOptionals++;
205 t[cur++].init(s[
i],p[i],u[i]);
220 for (
int i=p.
size();
i--; ) {
231 bool allMandatory =
true;
232 for (
int i=m.
size();
i--;) {
234 allMandatory =
false;
241 int nonOptionals = 0;
242 for (
int i=u.
size();
i--;)
243 if (u[
i]>0) nonOptionals++;
248 t[cur++].init(s[
i],p[i],u[i],m[i]);
264 for (
int i=p.
size();
i--; ) {
267 for (
int i=p.
size();
i--; ) {
278 for (
int i=p.
size();
i--;) {
286 for (
int i=p.
size();
i--;)
290 int nonOptionals = 0;
291 for (
int i=u.
size();
i--;)
292 if (u[
i]>0) nonOptionals++;
297 t[cur++].init(s[
i],p[i],e[i],u[i]);
312 for (
int i=p.
size();
i--; ) {
316 for (
int i=p.
size();
i--; ) {
326 bool allMandatory =
true;
327 for (
int i=m.
size();
i--;) {
329 allMandatory =
false;
336 int nonOptionals = 0;
337 for (
int i=u.
size();
i--;)
338 if (u[
i]>0) nonOptionals++;
341 for (
int i=s.
size();
i--; )
343 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.
Argument array for primtive types.
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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int val(void) const
Return assigned value.
ExecStatus manpost(Home home, Cap c, TaskArray< ManTask > &t, IntPropLevel ipl)
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
Passing integer variables.
Passing integer arguments.
Passing Boolean variables.
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 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.
#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.