Go to the documentation of this file.
38 #ifndef __GECODE_INT_TASK_HH__
39 #define __GECODE_INT_TASK_HH__
43 namespace Gecode {
namespace Int {
46 template<
class ManTask>
102 namespace Gecode {
namespace Int {
105 template<
class TaskView>
119 int pmin(
void)
const;
121 int pmax(
void)
const;
143 namespace Gecode {
namespace Int {
151 template<
class TaskView>
165 namespace Gecode {
namespace Int {
190 int size(
void)
const;
221 static void*
operator new(size_t);
222 static void operator delete(
void*,size_t);
229 template<
class Char,
class Traits,
class Task>
230 std::basic_ostream<Char,Traits>&
236 template<
class TaskView>
252 int size(
void)
const;
266 static void*
operator new(size_t);
267 static void operator delete(
void*,size_t);
274 template<
class Char,
class Traits,
class TaskView>
275 std::basic_ostream<Char,Traits>&
283 namespace Gecode {
namespace Int {
294 template<
class TaskView, SortTaskOrder sto,
bool inc>
298 template<
class TaskView, SortTaskOrder sto,
bool inc>
302 template<
class TaskView, SortTaskOrder sto,
bool inc>
309 namespace Gecode {
namespace Int {
312 template<
class TaskView, SortTaskOrder sto,
bool inc>
329 int left(
void)
const;
336 int task(
void)
const;
342 template<
class OptTaskView, SortTaskOrder sto,
bool inc>
356 namespace Gecode {
namespace Int {
362 long long int plus(
long long int x,
long long int y);
365 double plus(
double x,
double y);
368 template<
class TaskView,
class Node>
390 static bool left(
int i);
401 const Node&
root(
void)
const;
419 namespace Gecode {
namespace Int {
427 template<
class Task,
class PL>
446 template<
class OptTask,
class PL>
450 template<
class OptTask,
class PL,
class Cap>
491 namespace Gecode {
namespace Int {
516 int time(
void)
const;
530 template<
class Char,
class Traits>
531 std::basic_ostream<Char,Traits>&
Class to define an optional from a mandatory task.
@ ERT
Earliest required time of task.
int est(void) const
Return earliest start time.
Post propagator for SetVar x
Post propagator for SetVar SetOpType SetVar y
static const PropCond pc
For basic propagation, domain operations are needed.
int pmin(void) const
Return minimum processing time.
void operator++(void)
Move iterator to next task.
static const bool advanced
Do not perform advanced propagation.
static const bool advanced
Do not perform advanced propagation.
static const bool basic
Perform basic propagation.
Node & leaf(int i)
Return leaf for task i.
static int n_left(int i)
Return index of left child of node i.
@ EST
Earliest start time of task.
static bool n_root(int i)
Whether node i is index of root.
static const PropCond pc
For basic propagation, domain operations are needed.
Time-tabling event for task.
void subscribe(Space &home, Propagator &p, PropCond pc)
Subscribe propagator p to task.
int n_inner(void) const
Return number of inner nodes.
bool assigned(View x, int v)
Whether x is assigned to value v.
@ STO_EST
Sort by earliest start times.
int lst(void) const
Return latest start time.
static const PropCond pc
For basic propagation, domain operations are needed.
bool excluded(void) const
Whether task is excluded.
void reschedule(Space &home, Propagator &p, PropCond pc)
Schedule propagator p.
Gecode::IntArgs i(4, 1, 2, 3, 4)
static const bool basic
Perform basic propagation.
void init(Type e, int t, int i)
Initialize event.
int plus(int x, int y)
Safe addition in case x is -Int::Limits::infinity.
bool n_leaf(int i) const
Whether node i is leaf.
static bool left(int i)
Test whether node i is a left child.
Allows to iterate over mandatory task views according to a specified order.
@ STO_LST
Sort by latest start times.
@ STO_LCT
Sort by latest completion times.
static int n_right(int i)
Return index of right child of node i.
TaskViewIter(void)
Default constructor (no initialization)
Task mapper: turns a task view into its dual.
void subscribe(Space &home, Propagator &p, PropCond pc=Int::PC_INT_BND)
Subscribe propagator p to all tasks.
static const bool basic
Perform basic propagation.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Boolean view for Boolean variables.
Traits class for mapping tasks to task views.
Gecode toplevel namespace
Base-class for propagators.
ManTaskViewIter(Region &r, const TaskViewArray< OptTaskView > &t)
Initialize iterator with mandatory tasks.
SortTaskOrder
How to sort tasks.
@ STO_ECT
Sort by earliest completion times.
static const bool advanced
Do not perform advanced propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high linear)
TaskArray(void)
Default constructor (array of size 0)
void reschedule(Space &home, Propagator &p, PropCond pc=Int::PC_INT_BND)
Schedule propagator p.
ManToOptTask(void)
Default constructor.
Task & operator[](int i)
Return task at position i.
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
virtual void reschedule(Space &home)
Schedule function.
bool operator<(const Event &e) const
Order among events.
TaskProp(Home home, TaskArray< Task > &t)
Constructor for creation.
Type type(void) const
Return event type.
Task trees for task views with node type Node.
Traits class for mapping task views to tasks.
int idx(void) const
Return event index.
Post propagator for SetVar SetOpType SetVar SetRelType r
int task(void) const
Return current task position.
void sort(TaskViewArray< TaskView > &t)
Sort task view array t according to sto and inc (increasing or decreasing)
ModEventDelta med
A set of modification events (used during propagation)
bool operator()(void) const
Test whether iterator is still at a task.
const Node & root(void) const
Return root node.
static int n_parent(int i)
Return index of parent of node i.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const IdxViewArray< View > &x)
void update(Space &, bool share, TaskArray &a)
Update array to be a clone of array a.
void init(void)
Initialize tree after leaves have been initialized.
int * map
Map for iteration order.
bool mandatory(void) const
Whether task is mandatory.
Class for defining basic and advanced propagation level.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
int ModEvent
Type for modification events.
int ect(void) const
Return earliest completion time.
Class for defining basic propagation level.
@ LCT
Latest completion time of task.
void cancel(Space &home, Propagator &p, PropCond pc=Int::PC_INT_BND)
Cancel subscription of propagator p for all tasks.
ModEvent norun(Space &home, int e, int l)
Update such that task cannot run from e to l.
int PropCond
Type for propagation conditions.
int size(void) const
Return size of array (number of elements)
void update(void)
Update all inner nodes of tree after leaves have been initialized.
TaskArray< Task > & t
Access to task array.
TaskView & operator[](int i)
Return task view at position i.
const TaskArray< Task > & operator=(const TaskArray< Task > &a)
Initialize from task array a (share elements)
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p for task.
int pmax(void) const
Return maximum processing time.
int lct(void) const
Return latest completion time.
bool shared(const IntSet &, VX)
TaskArray< Task > t
Tasks.
int time(void) const
Return event time.
int * _leaf
Map task number to leaf node number in right order.
int n_nodes(void) const
Return number of nodes for balanced binary tree.
static Event * events(Region &r, const TaskArray< Task > &t, bool &assigned)
Allocate from r and initialize event array with tasks t.
Int::BoolView _m
Boolean view whether task is mandatory (= 1) or not.
int size(void) const
Return size of array (number of elements)
ExecStatus purge(Space &home, Propagator &p, TaskArray< OptTask > &t)
Purge optional tasks that are excluded and possibly rewrite propagator.
TaskViewTraits< TaskView >::Task Task
The underlying task type.
TaskViewArray(TaskArray< Task > &t)
Initialize from task array a.
unsigned int ei
Combines type and number of task.
static bool right(int i)
Test whether node i is a right child.
bool optional(void) const
Whether task can still be optional.
int left(void) const
How many tasks are left to be iterated.
Class for defining advanced propagation level.
Gecode::FloatVal c(-8, 8)
@ ZRO
Zero-length task start time.
int n
Number of negative literals for node type.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
const TaskViewArray< TaskView > & tasks
The tasks from which the tree is computed.
int ModEventDelta
Modification event deltas.
Type
Event type for task with order in which they are processed.
bool assigned(void) const
Test whether task is assigned.
void update(Space &home, bool share, ManToOptTask &t)
Update this task to be a clone of task t.
int p
Number of positive literals for node type.
@ LRT
Latest required time of task.
Allows to iterate over task views according to a specified order.