40namespace Gecode {
namespace Int {
namespace Cumulative {
47 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
48 (s.
size() !=
t.size()))
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());
79 for (
int i=0;
i<
t.size();
i++)
84 for (
int i=0;
i<
u.size();
i++)
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]);
111 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
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++;
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]);
168 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()))
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++;
205 t[cur++].init(s[
i],
p[
i],
u[
i]);
216 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
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++;
248 t[cur++].init(s[
i],
p[
i],
u[
i],m[
i]);
261 (s.
size() !=
u.size()))
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++) {
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++;
297 t[cur++].init(s[
i],
p[
i],e[
i],
u[
i]);
309 if ((s.
size() !=
p.size()) || (s.
size() !=
u.size()) ||
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++;
344 t[cur++].init(s[
i],
p[
i],e[
i],
u[
i],m[
i]);
union Gecode::@603::NNF::@65 u
Union depending on nodetype t.
int p
Number of positive literals for node type.
int size(void) const
Return size of array (number of elements)
Argument array for non-primitive types.
Passing Boolean variables.
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.
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.
bool assigned(View x, int v)
Whether x is assigned to value v.
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.
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Gecode::IntArgs i({1, 2, 3, 4})