36#ifndef __GECODE_INT_CUMULATIVE_HH__
37#define __GECODE_INT_CUMULATIVE_HH__
61 void mul_check(
long long int x,
long long int y,
long long int z);
92 long long int e(
void)
const;
107 template<
class Char,
class Traits>
108 std::basic_ostream<Char,Traits>&
146 long long int e(
void)
const;
161 template<
class Char,
class Traits>
162 std::basic_ostream<Char,Traits>&
188 long long int e(
void)
const;
203 template<
class Char,
class Traits>
204 std::basic_ostream<Char,Traits>&
230 template<
class Char,
class Traits>
231 std::basic_ostream<Char,Traits>&
256 template<
class Char,
class Traits>
257 std::basic_ostream<Char,Traits>&
282 template<
class Char,
class Traits>
283 std::basic_ostream<Char,Traits>&
290namespace Gecode {
namespace Int {
namespace Cumulative {
333 template<
class Char,
class Traits>
334 std::basic_ostream<Char,Traits>&
341 template<
class Char,
class Traits>
342 std::basic_ostream<Char,Traits>&
349 template<
class Char,
class Traits>
350 std::basic_ostream<Char,Traits>&
357 template<
class Char,
class Traits>
358 std::basic_ostream<Char,Traits>&
365namespace Gecode {
namespace Int {
544namespace Gecode {
namespace Int {
namespace Cumulative {
560 template<
class TaskView>
578 long long int env(
void)
const;
593 template<
class TaskView>
620 long long int env(
int i);
644 template<
class TaskView>
666 long long int env(
void)
const;
668 long long int lenv(
void)
const;
675namespace Gecode {
namespace Int {
namespace Cumulative {
680 subsumed(Space& home, Propagator& p,
int c, TaskArray<Task>& t);
683 template<
class ManTask>
687 template<
class Task,
class Cap>
701 template<
class ManTask,
class Cap,
class PL>
728 template<
class OptTask,
class Cap,
class PL>
750 template<
class ManTask,
class Cap>
755 template<
class OptTask,
class Cap>
Boolean integer variables.
Home class for posting propagators
Node for an extended omega tree.
void update(const ExtOmegaNode &l, const ExtOmegaNode &r)
Update node from left child l and right child r.
void init(const ExtOmegaNode &l, const ExtOmegaNode &r)
Initialize node from left child l and right child r.
long long int cenv
Energy envelope for subtree.
long long int env(int i)
Compute update for task with index i.
ExtOmegaTree(Region &r, int c, const TaskTree< TaskView, Node > &t)
Initialize tree for tasks t and capacity c.
void init(int ci)
Initialize tasks for current capacity ci.
Cumulative (mandatory) task with fixed processing, start or end time.
void init(TaskType t, IntVar s, int p, int c)
Initialize task.
long long int e(void) const
Return required energy.
ManFixPSETask(void)
Default constructor.
int c(void) const
Return required capacity.
void update(Space &home, ManFixPSETask &t)
Update this task to be a clone of task t.
Cumulative (mandatory) task with fixed processing time.
void init(IntVar s, int p, int c)
Initialize task with start time s, processing time p, and required resource c.
long long int e(void) const
Return required energy.
ManFixPTask(void)
Default constructor.
int c(void) const
Return required capacity.
void update(Space &home, ManFixPTask &t)
Update this task to be a clone of task t.
Cumulative (mandatory) task with flexible processing time.
void init(IntVar s, IntVar p, IntVar e, int c)
Initialize with start time s, processing time p, end time e.
long long int e(void) const
Return required energy.
void update(Space &home, ManFlexTask &t)
Update this task to be a clone of task t.
ManFlexTask(void)
Default constructor.
int c(void) const
Return required capacity.
virtual Actor * copy(Space &home)
Perform copying during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
static ExecStatus post(Home home, Cap c, TaskArray< ManTask > &t)
Post propagator that schedules tasks on cumulative resource.
ManProp(Home home, Cap c, TaskArray< ManTask > &t)
Constructor for creation.
Node for an omega lambda tree.
long long int le
Energy for subtree.
void init(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Initialize node from left child l and right child r.
void update(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Update node from left child l and right child r.
long long int lenv
Energy envelope for subtree.
int resLe
Node which is responsible for le.
static const int undef
Undefined task.
int resLenv
Node which is responsible for lenv.
int responsible(void) const
Return responsible task.
long long int lenv(void) const
Return energy envelope of all tasks excluding lambda tasks.
void shift(int i)
Shift task with index i from omega to lambda.
OmegaLambdaTree(Region &r, int c, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t and capcity c with all tasks included in omega.
void lremove(int i)
Remove task with index i from lambda.
long long int env(void) const
Return energy envelope of all tasks.
bool lempty(void) const
Whether has responsible task.
void init(const OmegaNode &l, const OmegaNode &r)
Initialize node from left child l and right child r.
void update(const OmegaNode &l, const OmegaNode &r)
Update node from left child l and right child r.
long long int e
Energy for subtree.
long long int env
Energy envelope for subtree.
void remove(int i)
Remove task with index i.
OmegaTree(Region &r, int c, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t and capacity c.
long long int env(void) const
Return energy envelope of all tasks.
void insert(int i)
Insert task with index i.
Cumulative optional task with fixed processing, start or end time.
void init(TaskType t, IntVar s, int p, int c, BoolVar m)
Initialize with start time s, processing time p, required capacity c, and mandatory flag m.
OptFixPSETask(void)
Default constructor.
Cumulative optional task with fixed processing time.
OptFixPTask(void)
Default constructor.
void init(IntVar s, int p, int c, BoolVar m)
Initialize with start time s, processing time p, required capacity c, and mandatory flag m.
Cumulative optional task with flexible processing time
OptFlexTask(void)
Default constructor.
void init(IntVar s, IntVar p, IntVar e, int c, BoolVar m)
Initialize with start time s, processing time p, end time e, and mandatory flag m.
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.
Task mapper: turns a task view into its dual.
TaskProp(Home home, TaskArray< ManTask > &t)
Cumulative::ManFixPSETaskBwd TaskViewBwd
The backward task view type.
Unary::ManFixPSETask UnaryTask
The corresponding unary task type.
Cumulative::ManFixPSETaskFwd TaskViewFwd
The forward task view type.
Cumulative::ManFixPTaskBwd TaskViewBwd
The backward task view type.
Unary::ManFixPTask UnaryTask
The corresponding unary task type.
Cumulative::ManFixPTaskFwd TaskViewFwd
The forward task view type.
Unary::ManFlexTask UnaryTask
The corresponding unary task type.
Cumulative::ManFlexTaskFwd TaskViewFwd
The forward task view type.
Cumulative::ManFlexTaskBwd TaskViewBwd
The backward task view type.
Cumulative::OptFixPSETaskBwd TaskViewBwd
The backward task view type.
Unary::OptFixPSETask UnaryTask
The corresponding unary task type.
Cumulative::ManFixPSETask ManTask
The corresponding mandatory task.
Cumulative::OptFixPSETaskFwd TaskViewFwd
The forward task view type.
Cumulative::ManFixPTask ManTask
The corresponding mandatory task.
Unary::OptFixPTask UnaryTask
The corresponding unary task type.
Cumulative::OptFixPTaskFwd TaskViewFwd
The forward task view type.
Cumulative::OptFixPTaskBwd TaskViewBwd
The backward task view type.
Cumulative::ManFlexTask ManTask
The corresponding mandatory task.
Unary::OptFlexTask UnaryTask
The corresponding unary task type.
Cumulative::OptFlexTaskBwd TaskViewBwd
The backward task view type.
Cumulative::OptFlexTaskFwd TaskViewFwd
The forward task view type.
Traits class for mapping tasks to task views.
const TaskViewArray< TaskView > & tasks
static int n_right(int i)
TaskTree(Region &r, const TaskViewArray< TaskView > &t)
void update(int i, bool l=true)
const OmegaNode & root(void) const
static int n_parent(int i)
static bool n_root(int i)
Cumulative::ManFixPSETask Task
The task type.
Cumulative::ManFixPSETask Task
The task type.
Cumulative::ManFixPTask Task
The task type.
Cumulative::ManFixPTask Task
The task type.
Cumulative::ManFlexTask Task
The task type.
Cumulative::ManFlexTask Task
The task type.
Cumulative::OptFixPSETask Task
The task type.
Cumulative::OptFixPSETask Task
The task type.
Cumulative::OptFixPTask Task
The task type.
Cumulative::OptFixPTask Task
The task type.
Cumulative::OptFlexTask Task
The task type.
Cumulative::OptFlexTask Task
The task type.
Traits class for mapping task views to tasks.
Unary (mandatory) task with fixed processing, start or end time
Unary (mandatory) task with fixed processing time
Unary (mandatory) task with flexible processing time
IntVar p(void) const
Return processing time.
Unary optional task with fixed processing, start or end time.
Unary optional task with fixed processing time
Unary optional task with flexible processing time
ModEventDelta med
A set of modification events (used during propagation)
int ModEventDelta
Modification event deltas.
TaskType
Type of task for scheduling constraints.
IntPropLevel
Propagation levels for integer propagators.
Scheduling for cumulative resources
FwdToBwd< ManFlexTaskFwd > ManFlexTaskBwd
Backward (dual) mandatory flexible task view.
ManFlexTask ManFlexTaskFwd
Forward mandatory flexible task view.
FwdToBwd< ManFixPSETaskFwd > ManFixPSETaskBwd
Backward (dual) mandatory fixed task view.
ExecStatus timetabling(Space &home, Propagator &p, Cap c, TaskArray< Task > &t)
Perform time-tabling propagation.
ExecStatus cmanpost(Home home, Cap c, TaskArray< ManTask > &t, IntPropLevel ipl)
Post mandatory task propagator according to propagation level.
OptFlexTask OptFlexTaskFwd
Forward optional flexible task view.
FwdToBwd< OptFixPTaskFwd > OptFixPTaskBwd
Backward (dual) optional fixed task view.
FwdToBwd< OptFlexTaskFwd > OptFlexTaskBwd
Backward (dual) optional flexible task view.
OptFixPTask OptFixPTaskFwd
Forward optional fixed task view.
FwdToBwd< OptFixPSETaskFwd > OptFixPSETaskBwd
Backward (dual) optional fixed task view.
void mul_check(long long int x, long long int y)
Throw exception if multiplication of x and y overflows.
ExecStatus coptpost(Home home, Cap c, TaskArray< OptTask > &t, IntPropLevel ipl)
Post optional task propagator according to propagation level.
FwdToBwd< ManFixPTaskFwd > ManFixPTaskBwd
Backward (dual) mandatory fixed task view.
ManFixPSETask ManFixPSETaskFwd
Forward mandatory fixed task view.
ExecStatus subsumed(Space &home, Propagator &p, int c, TaskArray< Task > &t)
Check for subsumption (all tasks must be assigned)
ManFixPTask ManFixPTaskFwd
Forward mandatory fixed task view.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const ManFixPTaskBwd &t)
OptFixPSETask OptFixPSETaskFwd
Forward optional fixed task view.
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.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Post propagator for SetVar SetOpType SetVar y
Post propagator for SetVar x