44 namespace Gecode {
namespace Int {
namespace Cumulative {
51 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
52 (s.
size() !=
t.size()))
55 for (
int i=
p.size();
i--; ) {
66 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
67 for (
int i=
u.size();
i--;) {
71 }
else if (
u[
i] < minU2)
77 (minU >
c.max()/2) || (minU2 >
c.max()/2 && minU+minU2>
c.max());
83 for (
int i=
t.size();
i--;)
88 for (
int i=
u.size();
i--;)
89 if (
u[
i]>0) nonOptionals++;
95 tasks[cur++].init(s[
i],
p[
i],
u[
i]);
100 for (
int i=s.
size();
i--;)
102 tasks[cur++].init(
t[
i],s[
i],
p[
i],
u[
i]);
115 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
119 for (
int i=
p.size();
i--; ) {
130 bool allMandatory =
true;
131 for (
int i=m.
size();
i--;) {
133 allMandatory =
false;
141 for (
int i=
t.size();
i--;)
145 int nonOptionals = 0;
146 for (
int i=
u.size();
i--;)
147 if (
u[
i]>0) nonOptionals++;
153 tasks[cur++].init(s[
i],
p[
i],
u[
i],m[
i]);
158 for (
int i=s.
size();
i--;)
160 tasks[cur++].init(
t[
i],s[
i],
p[
i],
u[
i],m[
i]);
172 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()))
175 for (
int i=
p.size();
i--; ) {
186 int minU = INT_MAX;
int minU2 = INT_MAX;
int maxU = INT_MIN;
187 for (
int i=
u.size();
i--;) {
191 }
else if (
u[
i] < minU2)
197 (minU >
c.max()/2) || (minU2 >
c.max()/2 && minU+minU2>
c.max());
202 int nonOptionals = 0;
203 for (
int i=
u.size();
i--;)
204 if (
u[
i]>0) nonOptionals++;
209 t[cur++].init(s[
i],
p[
i],
u[
i]);
220 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
224 for (
int i=
p.size();
i--; ) {
235 bool allMandatory =
true;
236 for (
int i=m.
size();
i--;) {
238 allMandatory =
false;
245 int nonOptionals = 0;
246 for (
int i=
u.size();
i--;)
247 if (
u[
i]>0) nonOptionals++;
252 t[cur++].init(s[
i],
p[
i],
u[
i],m[
i]);
265 (s.
size() !=
u.size()))
268 for (
int i=
p.size();
i--; ) {
271 for (
int i=
p.size();
i--; ) {
282 for (
int i=
p.size();
i--;) {
290 for (
int i=
p.size();
i--;)
294 int nonOptionals = 0;
295 for (
int i=
u.size();
i--;)
296 if (
u[
i]>0) nonOptionals++;
301 t[cur++].init(s[
i],
p[
i],e[
i],
u[
i]);
313 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
316 for (
int i=
p.size();
i--; ) {
320 for (
int i=
p.size();
i--; ) {
330 bool allMandatory =
true;
331 for (
int i=m.
size();
i--;) {
333 allMandatory =
false;
340 int nonOptionals = 0;
341 for (
int i=
u.size();
i--;)
342 if (
u[
i]>0) nonOptionals++;
345 for (
int i=s.
size();
i--; )
347 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)
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
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 .
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)
ExecStatus manpost(Home home, Cap c, TaskArray< ManTask > &t, IntPropLevel ipl)
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.