38 #ifndef __GECODE_INT_TASK_HH__
39 #define __GECODE_INT_TASK_HH__
43 namespace Gecode {
namespace Int {
46 template<
class ManTask>
100 namespace Gecode {
namespace Int {
103 template<
class TaskView>
117 int pmin(
void)
const;
119 int pmax(
void)
const;
141 namespace Gecode {
namespace Int {
149 template<
class TaskView>
163 namespace Gecode {
namespace Int {
188 int size(
void)
const;
217 static void*
operator new(size_t);
218 static void operator delete(
void*,size_t);
225 template<
class Char,
class Traits,
class Task>
226 std::basic_ostream<Char,Traits>&
227 operator <<(std::basic_ostream<Char,Traits>& os,
232 template<
class TaskView>
248 int size(
void)
const;
262 static void*
operator new(size_t);
263 static void operator delete(
void*,size_t);
270 template<
class Char,
class Traits,
class TaskView>
271 std::basic_ostream<Char,Traits>&
272 operator <<(std::basic_ostream<Char,Traits>& os,
279 namespace Gecode {
namespace Int {
290 template<
class TaskView, SortTaskOrder sto,
bool inc>
294 template<
class TaskView, SortTaskOrder sto,
bool inc>
298 template<
class TaskView, SortTaskOrder sto,
bool inc>
305 namespace Gecode {
namespace Int {
308 template<
class TaskView, SortTaskOrder sto,
bool inc>
325 int left(
void)
const;
332 int task(
void)
const;
338 template<
class OptTaskView, SortTaskOrder sto,
bool inc>
352 namespace Gecode {
namespace Int {
355 int plus(
int x,
int y);
358 long long int plus(
long long int x,
long long int y);
361 double plus(
double x,
double y);
364 template<
class TaskView,
class Node>
386 static bool left(
int i);
397 const Node&
root(
void)
const;
415 namespace Gecode {
namespace Int {
423 template<
class Task, PropCond pc>
440 template<
class OptTask,PropCond pc>
444 template<
class OptTask,PropCond pc,
class Cap>
Sort by earliest completion times.
int left(void) const
How many tasks are left to be iterated.
static int n_right(int i)
Return index of right child of node i.
ManTaskViewIter(Region &r, const TaskViewArray< OptTaskView > &t)
Initialize iterator with mandatory tasks.
static int n_left(int i)
Return index of left child of node i.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high linear)
TaskArray< Task > & t
Access to task array.
void operator++(void)
Move iterator to next task.
SortTaskOrder
How to sort tasks.
bool operator()(void) const
Test whether iterator is still at a task.
static bool right(int i)
Test whether node i is a right child.
ModEvent norun(Space &home, int e, int l)
Update such that task cannot run from e to l.
void subscribe(Space &home, Propagator &p, PropCond pc)
Subscribe propagator p to task.
int ModEvent
Type for modification events.
Base-class for propagators.
TaskArray(void)
Default constructor (array of size 0)
TaskViewArray(TaskArray< Task > &t)
Initialize from task array a.
Traits class for mapping tasks to task views.
Sort by earliest start times.
TaskViewIter(void)
Default constructor (no initialization)
Gecode::FloatVal c(-8, 8)
Task & operator[](int i)
Return task at position i.
void sort(TaskViewArray< TaskView > &t)
Sort task view array t according to sto and inc (increasing or decreasing)
int p
Number of positive literals for node type.
void update(Space &, bool share, TaskArray &a)
Update array to be a clone of array a.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
static int n_parent(int i)
Return index of parent of node i.
void update(void)
Update all inner nodes of tree after leaves have been initialized.
TaskViewTraits< TaskView >::Task Task
The underlying task type.
bool assigned(void) const
Test whether task is assigned.
void init(void)
Initialize tree after leaves have been initialized.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
int PropCond
Type for propagation conditions.
ModEventDelta med
A set of modification events (used during propagation)
Allows to iterate over task views according to a specified order.
int plus(int x, int y)
Safe addition in case x is -IntLimits::infinity.
bool optional(void) const
Whether task can still be optional.
ManToOptTask(void)
Default constructor.
TaskView & operator[](int i)
Return task view at position i.
Class to define an optional from a mandatory task.
TaskArray< Task > t
Tasks.
int * _leaf
Map task number to leaf node number in right order.
int size(void) const
Return size of array (number of elements)
int n_inner(void) const
Return number of inner nodes.
Sort by latest completion times.
int ect(void) const
Return earliest completion time.
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.
int est(void) const
Return earliest start time.
int * map
Map for iteration order.
bool n_leaf(int i) const
Whether node i is leaf.
Node * x
Pointer to corresponding Boolean expression node.
int task(void) const
Return current task position.
static bool left(int i)
Test whether node i is a left child.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
void cancel(Space &home, Propagator &p, PropCond pc=Int::PC_INT_BND)
Cancel subscription of propagator p for all tasks.
bool excluded(void) const
Whether task is excluded.
Node & leaf(int i)
Return leaf for task i.
int lct(void) const
Return latest completion time.
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p for task.
int pmin(void) const
Return minimum processing time.
int size(void) const
Return size of array (number of elements)
Allows to iterate over mandatory task views according to a specified order.
static bool n_root(int i)
Whether node i is index of root.
Traits class for mapping task views to tasks.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Int::BoolView _m
Boolean view whether task is mandatory (= 1) or not.
Gecode toplevel namespace
const Node & root(void) const
Return root node.
const TaskViewArray< TaskView > & tasks
The tasks from which the tree is computed.
void update(Space &home, bool share, ManToOptTask &t)
Update this task to be a clone of task t.
int lst(void) const
Return latest start time.
const TaskArray< Task > & operator=(const TaskArray< Task > &a)
Initialize from task array a (share elements)
int pmax(void) const
Return maximum processing time.
Sort by latest start times.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
int n_nodes(void) const
Return number of nodes for balanced binary tree.
Task trees for task views with node type Node.
TaskProp(Home home, TaskArray< Task > &t)
Constructor for creation.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
ExecStatus purge(Space &home, Propagator &p, TaskArray< OptTask > &t)
Purge optional tasks that are excluded and possibly rewrite propagator.
Boolean view for Boolean variables.
bool mandatory(void) const
Whether task is mandatory.