38namespace Gecode {
namespace Int {
namespace Cumulative {
40 template<
class OptTask,
class Cap,
class PL>
43 :
TaskProp<OptTask,PL>(home,t), c(c0) {
47 template<
class OptTask,
class Cap,
class PL>
54 template<
class OptTask,
class Cap,
class PL>
61 for (
int i=n; i--; ) {
62 if (t[i].c() > c.
max())
66 else if (t[i].mandatory())
72 if (t[0].mandatory()) {
75 }
else if (c.
min() >= t[0].c()) {
82 if (c.assigned() && (c.val() == 1)) {
84 for (
int i=0; i<t.
size(); i++)
91 for (
int i=0; i<m; i++)
100 template<
class OptTask,
class Cap,
class PL>
106 template<
class OptTask,
class Cap,
class PL>
111 return sizeof(*this);
114 template<
class OptTask,
class Cap,
class PL>
133 while ((i < n) && t[i].mandatory()) i++;
134 while ((j >= 0) && !t[j].mandatory()) j--;
136 std::swap(t[i],t[j]);
148 if (Cap::varderived() && c.assigned() && c.val()==1) {
150 for (
int i=0; i<t.
size(); i++)
155 for (
int i=0; i<t.
size(); i++)
162 if (!PL::basic && c.assigned())
Base-class for both propagators and branchers.
int size(void) const
Return size of array (number of elements)
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
Home class for posting propagators
Scheduling propagator for cumulative resource with mandatory tasks.
Scheduling propagator for cumulative resource with optional tasks.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
OptProp(Home home, Cap c, TaskArray< OptTask > &t)
Constructor for creation.
static ExecStatus post(Home home, Cap c, TaskArray< OptTask > &t)
Post propagator that schedules tasks on cumulative resource.
virtual Actor * copy(Space &home)
Perform copying during cloning.
int size(void) const
Return size of array (number of elements)
Traits class for mapping tasks to task views.
Scheduling propagator for unary resource with optional tasks
static ModEvent me(const ModEventDelta &med)
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
ExecStatus timetabling(Space &home, Propagator &p, Cap c, TaskArray< Task > &t)
Perform time-tabling propagation.
ExecStatus subsumed(Space &home, Propagator &p, int c, TaskArray< Task > &t)
Check for subsumption (all tasks must be assigned)
ExecStatus edgefinding(Space &home, int c, TaskArray< Task > &t)
Propagate by edge-finding.
ExecStatus overload(Space &home, int c, TaskArray< ManTask > &t)
Check mandatory tasks t for overload.
ExecStatus purge(Space &home, Propagator &p, TaskArray< OptTask > &t)
Purge optional tasks that are excluded and possibly rewrite propagator.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Gecode toplevel namespace
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
@ ES_OK
Execution is okay.
@ ES_NOFIX
Propagation has not computed fixpoint.