34 #ifndef __GECODE_INT_TASK_HH__ 35 #define __GECODE_INT_TASK_HH__ 39 namespace Gecode {
namespace Int {
42 template<
class ManTask>
98 namespace Gecode {
namespace Int {
101 template<
class TaskView>
115 int pmin(
void)
const;
117 int pmax(
void)
const;
139 namespace Gecode {
namespace Int {
147 template<
class TaskView>
161 namespace Gecode {
namespace Int {
186 int size(
void)
const;
194 Task& operator [](
int i);
197 const Task& operator [](
int i)
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;
256 TaskView& operator [](
int i);
259 const TaskView& operator [](
int i)
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>
322 bool operator ()(
void)
const;
325 int left(
void)
const;
327 void operator ++(
void);
332 int task(
void)
const;
338 template<
class OptTaskView, SortTaskOrder sto,
bool inc>
352 namespace Gecode {
namespace Int {
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>
376 int n_inner(
void)
const;
378 int n_nodes(
void)
const;
380 static bool n_root(
int i);
382 bool n_leaf(
int i)
const;
384 static int n_left(
int i);
386 static bool left(
int i);
388 static int n_right(
int i);
390 static bool right(
int i);
392 static int n_parent(
int i);
397 const Node& root(
void)
const;
415 namespace Gecode {
namespace Int {
423 template<
class Task,
class PL>
438 virtual size_t dispose(
Space& home);
442 template<
class OptTask,
class PL>
446 template<
class OptTask,
class PL,
class Cap>
453 static const bool basic =
true;
455 static const bool advanced =
false;
464 static const bool basic =
false;
466 static const bool advanced =
true;
475 static const bool basic =
true;
477 static const bool advanced =
true;
487 namespace Gecode {
namespace Int {
508 void init(
Type e,
int t,
int i);
510 Type type(
void)
const;
512 int time(
void)
const;
526 template<
class Char,
class Traits>
527 std::basic_ostream<Char,Traits>&
528 operator <<(std::basic_ostream<Char,Traits>& os,
const Event& e);
Sort by earliest completion times.
TaskArray< Task > & t
Access to task array.
unsigned int ei
Combines type and number of task.
Class for defining basic propagation level.
bool excluded(void) const
Whether task is excluded.
void reschedule(Space &home, Propagator &p, PropCond pc)
Schedule propagator p.
SortTaskOrder
How to sort tasks.
void subscribe(Space &home, Propagator &p, PropCond pc)
Subscribe propagator p to task.
int ModEvent
Type for modification events.
Base-class for propagators.
Traits class for mapping tasks to task views.
Sort by earliest start times.
Class for defining advanced propagation level.
Gecode::FloatVal c(-8, 8)
Class for defining basic and advanced propagation level.
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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Time-tabling event for task.
TaskViewTraits< TaskView >::Task Task
The underlying task type.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
int PropCond
Type for propagation conditions.
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.
unsigned int size(I &i)
Size of all ranges of range iterator i.
ManToOptTask(void)
Default constructor.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Class to define an optional from a mandatory task.
int * _leaf
Map task number to leaf node number in right order.
Sort by latest completion times.
Task mapper: turns a task view into its dual.
Post propagator for SetVar SetOpType SetVar SetRelType r
int * map
Map for iteration order.
Post propagator for SetVar SetOpType SetVar y
bool mandatory(void) const
Whether task is mandatory.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p for task.
Allows to iterate over mandatory task views according to a specified order.
Post propagator for SetVar x
bool optional(void) const
Whether task can still be optional.
Traits class for mapping task views to tasks.
bool operator<(const FloatVal &x, const FloatVal &y)
Int::BoolView _m
Boolean view whether task is mandatory (= 1) or not.
Gecode toplevel namespace
const TaskViewArray< TaskView > & tasks
The tasks from which the tree is computed.
TaskArray< Task > t
Tasks.
void update(Space &home, ManToOptTask &t)
Update this task to be a clone of task t.
Sort by latest start times.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
Task trees for task views with node type Node.
Type
Event type for task with order in which they are processed.
ExecStatus purge(Space &home, Propagator &p, TaskArray< OptTask > &t)
Purge optional tasks that are excluded and possibly rewrite propagator.
bool assigned(void) const
Test whether task is assigned.
Boolean view for Boolean variables.