cumulative.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Christian Schulte, 2009
* Guido Tack, 2010
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_INT_CUMULATIVE_HH__
#define __GECODE_INT_CUMULATIVE_HH__
#include <gecode/int/task.hh>
#include <gecode/int/unary.hh>
namespace Gecode { namespace Int { namespace Cumulative {
void mul_check(long long int x, long long int y);
void mul_check(long long int x, long long int y, long long int z);
}}}
#include <gecode/int/cumulative/limits.hpp>
namespace Gecode { namespace Int { namespace Cumulative {
class ManFixPTask : public Unary::ManFixPTask {
protected:
int _c;
public:
ManFixPTask(void);
ManFixPTask(IntVar s, int p, int c);
void init(IntVar s, int p, int c);
void init(const ManFixPTask& t);
int c(void) const;
long long int e(void) const;
void update(Space& home, ManFixPTask& t);
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const ManFixPTask& t);
class ManFixPSETask : public Unary::ManFixPSETask {
protected:
int _c;
public:
ManFixPSETask(void);
ManFixPSETask(TaskType t, IntVar s, int p, int c);
void init(TaskType t, IntVar s, int p, int c);
void init(const ManFixPSETask& t);
int c(void) const;
long long int e(void) const;
void update(Space& home, ManFixPSETask& t);
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const ManFixPSETask& t);
class ManFlexTask : public Unary::ManFlexTask {
protected:
int _c;
public:
ManFlexTask(void);
ManFlexTask(IntVar s, IntVar p, IntVar e, int c);
void init(IntVar s, IntVar p, IntVar e, int c);
void init(const ManFlexTask& t);
int c(void) const;
long long int e(void) const;
void update(Space& home, ManFlexTask& t);
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const ManFlexTask& t);
class OptFixPTask : public ManToOptTask<ManFixPTask> {
protected:
using ManToOptTask<ManFixPTask>::_m;
public:
OptFixPTask(void);
OptFixPTask(IntVar s, int p, int c, BoolVar m);
void init(IntVar s, int p, int c, BoolVar m);
operator Unary::OptFixPTask (void);
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const OptFixPTask& t);
class OptFixPSETask : public ManToOptTask<ManFixPSETask> {
protected:
using ManToOptTask<ManFixPSETask>::_m;
public:
OptFixPSETask(void);
OptFixPSETask(TaskType t, IntVar s, int p, int c, BoolVar m);
void init(TaskType t, IntVar s, int p, int c, BoolVar m);
operator Unary::OptFixPSETask (void);
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const OptFixPSETask& t);
class OptFlexTask : public ManToOptTask<ManFlexTask> {
protected:
using ManToOptTask<ManFlexTask>::_m;
public:
OptFlexTask(void);
OptFlexTask(IntVar s, IntVar p, IntVar e, int c, BoolVar m);
void init(IntVar s, IntVar p, IntVar e, int c, BoolVar m);
operator Unary::OptFlexTask (void);
};
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const OptFlexTask& t);
}}}
#include <gecode/int/cumulative/task.hpp>
namespace Gecode { namespace Int { namespace Cumulative {
typedef ManFixPTask ManFixPTaskFwd;
typedef FwdToBwd<ManFixPTaskFwd> ManFixPTaskBwd;
typedef ManFixPSETask ManFixPSETaskFwd;
typedef FwdToBwd<ManFixPSETaskFwd> ManFixPSETaskBwd;
typedef OptFixPTask OptFixPTaskFwd;
typedef FwdToBwd<OptFixPTaskFwd> OptFixPTaskBwd;
typedef OptFixPSETask OptFixPSETaskFwd;
typedef FwdToBwd<OptFixPSETaskFwd> OptFixPSETaskBwd;
typedef ManFlexTask ManFlexTaskFwd;
typedef FwdToBwd<ManFlexTaskFwd> ManFlexTaskBwd;
typedef OptFlexTask OptFlexTaskFwd;
typedef FwdToBwd<OptFlexTaskFwd> OptFlexTaskBwd;
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const ManFixPTaskBwd& t);
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const ManFixPSETaskBwd& t);
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const OptFixPTaskBwd& t);
template<class Char, class Traits>
std::basic_ostream<Char,Traits>&
operator <<(std::basic_ostream<Char,Traits>& os, const OptFixPSETaskBwd& t);
}}}
#include <gecode/int/cumulative/task-view.hpp>
namespace Gecode { namespace Int {
template<>
class TaskViewTraits<Cumulative::ManFixPTaskFwd> {
public:
typedef Cumulative::ManFixPTask Task;
};
template<>
class TaskViewTraits<Cumulative::ManFixPTaskBwd> {
public:
typedef Cumulative::ManFixPTask Task;
};
template<>
class TaskViewTraits<Cumulative::ManFixPSETaskFwd> {
public:
typedef Cumulative::ManFixPSETask Task;
};
template<>
class TaskViewTraits<Cumulative::ManFixPSETaskBwd> {
public:
typedef Cumulative::ManFixPSETask Task;
};
template<>
class TaskViewTraits<Cumulative::OptFixPTaskFwd> {
public:
typedef Cumulative::OptFixPTask Task;
};
template<>
class TaskViewTraits<Cumulative::OptFixPTaskBwd> {
public:
typedef Cumulative::OptFixPTask Task;
};
template<>
class TaskViewTraits<Cumulative::OptFixPSETaskFwd> {
public:
typedef Cumulative::OptFixPSETask Task;
};
template<>
class TaskViewTraits<Cumulative::OptFixPSETaskBwd> {
public:
typedef Cumulative::OptFixPSETask Task;
};
template<>
class TaskViewTraits<Cumulative::ManFlexTaskFwd> {
public:
typedef Cumulative::ManFlexTask Task;
};
template<>
class TaskViewTraits<Cumulative::ManFlexTaskBwd> {
public:
typedef Cumulative::ManFlexTask Task;
};
template<>
class TaskViewTraits<Cumulative::OptFlexTaskFwd> {
public:
typedef Cumulative::OptFlexTask Task;
};
template<>
class TaskViewTraits<Cumulative::OptFlexTaskBwd> {
public:
typedef Cumulative::OptFlexTask Task;
};
template<>
class TaskTraits<Cumulative::ManFixPTask> {
public:
typedef Cumulative::ManFixPTaskFwd TaskViewFwd;
typedef Cumulative::ManFixPTaskBwd TaskViewBwd;
typedef Unary::ManFixPTask UnaryTask;
};
template<>
class TaskTraits<Cumulative::ManFixPSETask> {
public:
typedef Cumulative::ManFixPSETaskFwd TaskViewFwd;
typedef Cumulative::ManFixPSETaskBwd TaskViewBwd;
typedef Unary::ManFixPSETask UnaryTask;
};
template<>
class TaskTraits<Cumulative::OptFixPTask> {
public:
typedef Cumulative::OptFixPTaskFwd TaskViewFwd;
typedef Cumulative::OptFixPTaskBwd TaskViewBwd;
typedef Cumulative::ManFixPTask ManTask;
typedef Unary::OptFixPTask UnaryTask;
};
template<>
class TaskTraits<Cumulative::OptFixPSETask> {
public:
typedef Cumulative::OptFixPSETaskFwd TaskViewFwd;
typedef Cumulative::OptFixPSETaskBwd TaskViewBwd;
typedef Cumulative::ManFixPSETask ManTask;
typedef Unary::OptFixPSETask UnaryTask;
};
template<>
class TaskTraits<Cumulative::ManFlexTask> {
public:
typedef Cumulative::ManFlexTaskFwd TaskViewFwd;
typedef Cumulative::ManFlexTaskBwd TaskViewBwd;
typedef Unary::ManFlexTask UnaryTask;
};
template<>
class TaskTraits<Cumulative::OptFlexTask> {
public:
typedef Cumulative::OptFlexTaskFwd TaskViewFwd;
typedef Cumulative::OptFlexTaskBwd TaskViewBwd;
typedef Cumulative::ManFlexTask ManTask;
typedef Unary::OptFlexTask UnaryTask;
};
}}
namespace Gecode { namespace Int { namespace Cumulative {
class OmegaNode {
public:
long long int e;
long long int env;
void init(const OmegaNode& l, const OmegaNode& r);
void update(const OmegaNode& l, const OmegaNode& r);
};
template<class TaskView>
class OmegaTree : public TaskTree<TaskView,OmegaNode> {
protected:
using TaskTree<TaskView,OmegaNode>::tasks;
using TaskTree<TaskView,OmegaNode>::leaf;
using TaskTree<TaskView,OmegaNode>::root;
using TaskTree<TaskView,OmegaNode>::init;
using TaskTree<TaskView,OmegaNode>::update;
int c;
public:
OmegaTree(Region& r, int c, const TaskViewArray<TaskView>& t);
void insert(int i);
void remove(int i);
long long int env(void) const;
};
class ExtOmegaNode : public OmegaNode {
public:
long long int cenv;
void init(const ExtOmegaNode& l, const ExtOmegaNode& r);
void update(const ExtOmegaNode& l, const ExtOmegaNode& r);
};
template<class TaskView>
class ExtOmegaTree : public TaskTree<TaskView,ExtOmegaNode> {
protected:
using TaskTree<TaskView,ExtOmegaNode>::tasks;
using TaskTree<TaskView,ExtOmegaNode>::leaf;
using TaskTree<TaskView,ExtOmegaNode>::root;
using TaskTree<TaskView,ExtOmegaNode>::init;
using TaskTree<TaskView,ExtOmegaNode>::update;
using TaskTree<TaskView,ExtOmegaNode>::node;
using TaskTree<TaskView,ExtOmegaNode>::n_leaf;
using TaskTree<TaskView,ExtOmegaNode>::n_left;
using TaskTree<TaskView,ExtOmegaNode>::left;
using TaskTree<TaskView,ExtOmegaNode>::n_right;
using TaskTree<TaskView,ExtOmegaNode>::right;
using TaskTree<TaskView,ExtOmegaNode>::n_root;
using TaskTree<TaskView,ExtOmegaNode>::n_parent;
using TaskTree<TaskView,ExtOmegaNode>::n_nodes;
using TaskTree<TaskView,ExtOmegaNode>::_leaf;
int c, ci;
public:
template<class Node>
ExtOmegaTree(Region& r, int c, const TaskTree<TaskView,Node>& t);
void init(int ci);
long long int env(int i);
};
class OmegaLambdaNode : public OmegaNode {
public:
static const int undef = -1;
long long int le;
long long int lenv;
int resLe;
int resLenv;
void init(const OmegaLambdaNode& l, const OmegaLambdaNode& r);
void update(const OmegaLambdaNode& l, const OmegaLambdaNode& r);
};
template<class TaskView>
class OmegaLambdaTree : public TaskTree<TaskView,OmegaLambdaNode> {
protected:
using TaskTree<TaskView,OmegaLambdaNode>::tasks;
using TaskTree<TaskView,OmegaLambdaNode>::leaf;
using TaskTree<TaskView,OmegaLambdaNode>::root;
using TaskTree<TaskView,OmegaLambdaNode>::init;
using TaskTree<TaskView,OmegaLambdaNode>::update;
int c;
public:
OmegaLambdaTree(Region& r, int c, const TaskViewArray<TaskView>& t);
void shift(int i);
void lremove(int i);
bool lempty(void) const;
int responsible(void) const;
long long int env(void) const;
long long int lenv(void) const;
};
}}}
#include <gecode/int/cumulative/tree.hpp>
namespace Gecode { namespace Int { namespace Cumulative {
template<class Task>
ExecStatus
subsumed(Space& home, Propagator& p, int c, TaskArray<Task>& t);
template<class ManTask>
ExecStatus overload(Space& home, int c, TaskArray<ManTask>& t);
template<class Task, class Cap>
ExecStatus timetabling(Space& home, Propagator& p, Cap c,
TaskArray<Task>& t);
template<class Task>
ExecStatus edgefinding(Space& home, int c, TaskArray<Task>& t);
template<class ManTask, class Cap, class PL>
class ManProp : public TaskProp<ManTask,PL> {
protected:
using TaskProp<ManTask,PL>::t;
Cap c;
ManProp(Home home, Cap c, TaskArray<ManTask>& t);
ManProp(Space& home, ManProp& p);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, Cap c, TaskArray<ManTask>& t);
virtual size_t dispose(Space& home);
};
template<class OptTask, class Cap, class PL>
class OptProp : public TaskProp<OptTask,PL> {
protected:
using TaskProp<OptTask,PL>::t;
Cap c;
OptProp(Home home, Cap c, TaskArray<OptTask>& t);
OptProp(Space& home, OptProp& p);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, Cap c, TaskArray<OptTask>& t);
virtual size_t dispose(Space& home);
};
template<class ManTask, class Cap>
ExecStatus
cmanpost(Home home, Cap c, TaskArray<ManTask>& t, IntPropLevel ipl);
template<class OptTask, class Cap>
ExecStatus
coptpost(Home home, Cap c, TaskArray<OptTask>& t, IntPropLevel ipl);
}}}
#include <gecode/int/cumulative/time-tabling.hpp>
#include <gecode/int/cumulative/subsumption.hpp>
#include <gecode/int/cumulative/overload.hpp>
#include <gecode/int/cumulative/edge-finding.hpp>
#include <gecode/int/cumulative/man-prop.hpp>
#include <gecode/int/cumulative/opt-prop.hpp>
#include <gecode/int/cumulative/post.hpp>
#endif
// STATISTICS: int-prop
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::Int::Cumulative::ExtOmegaNode
Node for an extended omega tree.
Definition cumulative.hh:582
Gecode::Int::Cumulative::ExtOmegaNode::update
void update(const ExtOmegaNode &l, const ExtOmegaNode &r)
Update node from left child l and right child r.
Definition tree.hpp:98
Gecode::Int::Cumulative::ExtOmegaNode::init
void init(const ExtOmegaNode &l, const ExtOmegaNode &r)
Initialize node from left child l and right child r.
Definition tree.hpp:92
Gecode::Int::Cumulative::ExtOmegaNode::cenv
long long int cenv
Energy envelope for subtree.
Definition cumulative.hh:585
Gecode::Int::Cumulative::ExtOmegaTree::c
int c
Capacity.
Definition cumulative.hh:612
Gecode::Int::Cumulative::ExtOmegaTree::ci
int ci
Definition cumulative.hh:612
Gecode::Int::Cumulative::ExtOmegaTree::env
long long int env(int i)
Compute update for task with index i.
Definition tree.hpp:120
Gecode::Int::Cumulative::ExtOmegaTree::ExtOmegaTree
ExtOmegaTree(Region &r, int c, const TaskTree< TaskView, Node > &t)
Initialize tree for tasks t and capacity c.
Definition tree.hpp:114
Gecode::Int::Cumulative::ExtOmegaTree::init
void init(int ci)
Initialize tasks for current capacity ci.
Definition tree.hpp:104
Gecode::Int::Cumulative::ManFixPSETask
Cumulative (mandatory) task with fixed processing, start or end time.
Definition cumulative.hh:112
Gecode::Int::Cumulative::ManFixPSETask::init
void init(TaskType t, IntVar s, int p, int c)
Initialize task.
Definition task.hpp:89
Gecode::Int::Cumulative::ManFixPSETask::e
long long int e(void) const
Return required energy.
Definition task.hpp:102
Gecode::Int::Cumulative::ManFixPSETask::ManFixPSETask
ManFixPSETask(void)
Default constructor.
Definition task.hpp:84
Gecode::Int::Cumulative::ManFixPSETask::c
int c(void) const
Return required capacity.
Definition task.hpp:98
Gecode::Int::Cumulative::ManFixPSETask::_c
int _c
Required capacity.
Definition cumulative.hh:115
Gecode::Int::Cumulative::ManFixPSETask::update
void update(Space &home, ManFixPSETask &t)
Update this task to be a clone of task t.
Definition task.hpp:107
Gecode::Int::Cumulative::ManFixPTask
Cumulative (mandatory) task with fixed processing time.
Definition cumulative.hh:70
Gecode::Int::Cumulative::ManFixPTask::init
void init(IntVar s, int p, int c)
Initialize task with start time s, processing time p, and required resource c.
Definition task.hpp:48
Gecode::Int::Cumulative::ManFixPTask::e
long long int e(void) const
Return required energy.
Definition task.hpp:61
Gecode::Int::Cumulative::ManFixPTask::ManFixPTask
ManFixPTask(void)
Default constructor.
Definition task.hpp:43
Gecode::Int::Cumulative::ManFixPTask::c
int c(void) const
Return required capacity.
Definition task.hpp:57
Gecode::Int::Cumulative::ManFixPTask::update
void update(Space &home, ManFixPTask &t)
Update this task to be a clone of task t.
Definition task.hpp:66
Gecode::Int::Cumulative::ManFixPTask::_c
int _c
Required capacity.
Definition cumulative.hh:73
Gecode::Int::Cumulative::ManFlexTask
Cumulative (mandatory) task with flexible processing time.
Definition cumulative.hh:166
Gecode::Int::Cumulative::ManFlexTask::init
void init(IntVar s, IntVar p, IntVar e, int c)
Initialize with start time s, processing time p, end time e.
Definition task.hpp:130
Gecode::Int::Cumulative::ManFlexTask::_c
int _c
Required capacity.
Definition cumulative.hh:169
Gecode::Int::Cumulative::ManFlexTask::e
long long int e(void) const
Return required energy.
Definition task.hpp:143
Gecode::Int::Cumulative::ManFlexTask::update
void update(Space &home, ManFlexTask &t)
Update this task to be a clone of task t.
Definition task.hpp:148
Gecode::Int::Cumulative::ManFlexTask::ManFlexTask
ManFlexTask(void)
Default constructor.
Definition task.hpp:125
Gecode::Int::Cumulative::ManFlexTask::c
int c(void) const
Return required capacity.
Definition task.hpp:139
Gecode::Int::Cumulative::ManProp::copy
virtual Actor * copy(Space &home)
Perform copying during cloning.
Definition man-prop.hpp:79
Gecode::Int::Cumulative::ManProp::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition man-prop.hpp:93
Gecode::Int::Cumulative::ManProp::c
Cap c
Resource capacity.
Definition cumulative.hh:706
Gecode::Int::Cumulative::ManProp::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition man-prop.hpp:85
Gecode::Int::Cumulative::ManProp::post
static ExecStatus post(Home home, Cap c, TaskArray< ManTask > &t)
Post propagator that schedules tasks on cumulative resource.
Definition man-prop.hpp:54
Gecode::Int::Cumulative::ManProp::ManProp
ManProp(Home home, Cap c, TaskArray< ManTask > &t)
Constructor for creation.
Definition man-prop.hpp:40
Gecode::Int::Cumulative::OmegaLambdaNode
Node for an omega lambda tree.
Definition cumulative.hh:625
Gecode::Int::Cumulative::OmegaLambdaNode::le
long long int le
Energy for subtree.
Definition cumulative.hh:630
Gecode::Int::Cumulative::OmegaLambdaNode::init
void init(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Initialize node from left child l and right child r.
Definition tree.hpp:174
Gecode::Int::Cumulative::OmegaLambdaNode::update
void update(const OmegaLambdaNode &l, const OmegaLambdaNode &r)
Update node from left child l and right child r.
Definition tree.hpp:181
Gecode::Int::Cumulative::OmegaLambdaNode::lenv
long long int lenv
Energy envelope for subtree.
Definition cumulative.hh:632
Gecode::Int::Cumulative::OmegaLambdaNode::resLe
int resLe
Node which is responsible for le.
Definition cumulative.hh:634
Gecode::Int::Cumulative::OmegaLambdaNode::undef
static const int undef
Undefined task.
Definition cumulative.hh:628
Gecode::Int::Cumulative::OmegaLambdaNode::resLenv
int resLenv
Node which is responsible for lenv.
Definition cumulative.hh:636
Gecode::Int::Cumulative::OmegaLambdaTree::responsible
int responsible(void) const
Return responsible task.
Definition tree.hpp:254
Gecode::Int::Cumulative::OmegaLambdaTree::lenv
long long int lenv(void) const
Return energy envelope of all tasks excluding lambda tasks.
Definition tree.hpp:266
Gecode::Int::Cumulative::OmegaLambdaTree::shift
void shift(int i)
Shift task with index i from omega to lambda.
Definition tree.hpp:221
Gecode::Int::Cumulative::OmegaLambdaTree::OmegaLambdaTree
OmegaLambdaTree(Region &r, int c, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t and capcity c with all tasks included in omega.
Definition tree.hpp:204
Gecode::Int::Cumulative::OmegaLambdaTree::c
int c
Capacity.
Definition cumulative.hh:653
Gecode::Int::Cumulative::OmegaLambdaTree::lremove
void lremove(int i)
Remove task with index i from lambda.
Definition tree.hpp:235
Gecode::Int::Cumulative::OmegaLambdaTree::env
long long int env(void) const
Return energy envelope of all tasks.
Definition tree.hpp:260
Gecode::Int::Cumulative::OmegaLambdaTree::lempty
bool lempty(void) const
Whether has responsible task.
Definition tree.hpp:248
Gecode::Int::Cumulative::OmegaNode
Node for an omega tree.
Definition cumulative.hh:547
Gecode::Int::Cumulative::OmegaNode::init
void init(const OmegaNode &l, const OmegaNode &r)
Initialize node from left child l and right child r.
Definition tree.hpp:46
Gecode::Int::Cumulative::OmegaNode::update
void update(const OmegaNode &l, const OmegaNode &r)
Update node from left child l and right child r.
Definition tree.hpp:51
Gecode::Int::Cumulative::OmegaNode::e
long long int e
Energy for subtree.
Definition cumulative.hh:550
Gecode::Int::Cumulative::OmegaNode::env
long long int env
Energy envelope for subtree.
Definition cumulative.hh:552
Gecode::Int::Cumulative::OmegaTree::remove
void remove(int i)
Remove task with index i.
Definition tree.hpp:76
Gecode::Int::Cumulative::OmegaTree::OmegaTree
OmegaTree(Region &r, int c, const TaskViewArray< TaskView > &t)
Initialize tree for tasks t and capacity c.
Definition tree.hpp:56
Gecode::Int::Cumulative::OmegaTree::c
int c
Capacity.
Definition cumulative.hh:569
Gecode::Int::Cumulative::OmegaTree::env
long long int env(void) const
Return energy envelope of all tasks.
Definition tree.hpp:83
Gecode::Int::Cumulative::OmegaTree::insert
void insert(int i)
Insert task with index i.
Definition tree.hpp:67
Gecode::Int::Cumulative::OptFixPSETask
Cumulative optional task with fixed processing, start or end time.
Definition cumulative.hh:235
Gecode::Int::Cumulative::OptFixPSETask::init
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.
Definition task.hpp:202
Gecode::Int::Cumulative::OptFixPSETask::OptFixPSETask
OptFixPSETask(void)
Default constructor.
Definition task.hpp:196
Gecode::Int::Cumulative::OptFixPTask
Cumulative optional task with fixed processing time.
Definition cumulative.hh:209
Gecode::Int::Cumulative::OptFixPTask::OptFixPTask
OptFixPTask(void)
Default constructor.
Definition task.hpp:167
Gecode::Int::Cumulative::OptFixPTask::init
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.
Definition task.hpp:173
Gecode::Int::Cumulative::OptFlexTask
Cumulative optional task with flexible processing time
Definition cumulative.hh:261
Gecode::Int::Cumulative::OptFlexTask::OptFlexTask
OptFlexTask(void)
Default constructor.
Definition task.hpp:225
Gecode::Int::Cumulative::OptFlexTask::init
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.
Definition task.hpp:231
Gecode::Int::Cumulative::OptProp::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition opt-prop.hpp:116
Gecode::Int::Cumulative::OptProp::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition opt-prop.hpp:108
Gecode::Int::Cumulative::OptProp::OptProp
OptProp(Home home, Cap c, TaskArray< OptTask > &t)
Constructor for creation.
Definition opt-prop.hpp:42
Gecode::Int::Cumulative::OptProp::post
static ExecStatus post(Home home, Cap c, TaskArray< OptTask > &t)
Post propagator that schedules tasks on cumulative resource.
Definition opt-prop.hpp:56
Gecode::Int::Cumulative::OptProp::copy
virtual Actor * copy(Space &home)
Perform copying during cloning.
Definition opt-prop.hpp:102
Gecode::Int::Cumulative::OptProp::c
Cap c
Resource capacity.
Definition cumulative.hh:733
Gecode::Int::FwdToBwd
Task mapper: turns a task view into its dual.
Definition task.hh:102
Gecode::Int::ManToOptTask< ManFixPTask >::_m
Int::BoolView _m
Definition task.hh:46
Gecode::Int::ManToOptTask< ManFixPTask >::ManToOptTask
ManToOptTask(void)
Definition man-to-opt.hpp:38
Gecode::Int::TaskArray
Task array.
Definition task.hh:165
Gecode::Int::TaskProp< ManTask, PL >::t
TaskArray< ManTask > t
Definition task.hh:427
Gecode::Int::TaskProp< ManTask, PL >::TaskProp
TaskProp(Home home, TaskArray< ManTask > &t)
Definition prop.hpp:38
Gecode::Int::TaskTraits< Cumulative::ManFixPSETask >::TaskViewBwd
Cumulative::ManFixPSETaskBwd TaskViewBwd
The backward task view type.
Definition cumulative.hh:483
Gecode::Int::TaskTraits< Cumulative::ManFixPSETask >::UnaryTask
Unary::ManFixPSETask UnaryTask
The corresponding unary task type.
Definition cumulative.hh:485
Gecode::Int::TaskTraits< Cumulative::ManFixPSETask >::TaskViewFwd
Cumulative::ManFixPSETaskFwd TaskViewFwd
The forward task view type.
Definition cumulative.hh:481
Gecode::Int::TaskTraits< Cumulative::ManFixPTask >::TaskViewBwd
Cumulative::ManFixPTaskBwd TaskViewBwd
The backward task view type.
Definition cumulative.hh:471
Gecode::Int::TaskTraits< Cumulative::ManFixPTask >::UnaryTask
Unary::ManFixPTask UnaryTask
The corresponding unary task type.
Definition cumulative.hh:473
Gecode::Int::TaskTraits< Cumulative::ManFixPTask >::TaskViewFwd
Cumulative::ManFixPTaskFwd TaskViewFwd
The forward task view type.
Definition cumulative.hh:469
Gecode::Int::TaskTraits< Cumulative::ManFlexTask >::UnaryTask
Unary::ManFlexTask UnaryTask
The corresponding unary task type.
Definition cumulative.hh:525
Gecode::Int::TaskTraits< Cumulative::ManFlexTask >::TaskViewFwd
Cumulative::ManFlexTaskFwd TaskViewFwd
The forward task view type.
Definition cumulative.hh:521
Gecode::Int::TaskTraits< Cumulative::ManFlexTask >::TaskViewBwd
Cumulative::ManFlexTaskBwd TaskViewBwd
The backward task view type.
Definition cumulative.hh:523
Gecode::Int::TaskTraits< Cumulative::OptFixPSETask >::TaskViewBwd
Cumulative::OptFixPSETaskBwd TaskViewBwd
The backward task view type.
Definition cumulative.hh:509
Gecode::Int::TaskTraits< Cumulative::OptFixPSETask >::UnaryTask
Unary::OptFixPSETask UnaryTask
The corresponding unary task type.
Definition cumulative.hh:513
Gecode::Int::TaskTraits< Cumulative::OptFixPSETask >::ManTask
Cumulative::ManFixPSETask ManTask
The corresponding mandatory task.
Definition cumulative.hh:511
Gecode::Int::TaskTraits< Cumulative::OptFixPSETask >::TaskViewFwd
Cumulative::OptFixPSETaskFwd TaskViewFwd
The forward task view type.
Definition cumulative.hh:507
Gecode::Int::TaskTraits< Cumulative::OptFixPTask >::ManTask
Cumulative::ManFixPTask ManTask
The corresponding mandatory task.
Definition cumulative.hh:497
Gecode::Int::TaskTraits< Cumulative::OptFixPTask >::UnaryTask
Unary::OptFixPTask UnaryTask
The corresponding unary task type.
Definition cumulative.hh:499
Gecode::Int::TaskTraits< Cumulative::OptFixPTask >::TaskViewFwd
Cumulative::OptFixPTaskFwd TaskViewFwd
The forward task view type.
Definition cumulative.hh:493
Gecode::Int::TaskTraits< Cumulative::OptFixPTask >::TaskViewBwd
Cumulative::OptFixPTaskBwd TaskViewBwd
The backward task view type.
Definition cumulative.hh:495
Gecode::Int::TaskTraits< Cumulative::OptFlexTask >::ManTask
Cumulative::ManFlexTask ManTask
The corresponding mandatory task.
Definition cumulative.hh:537
Gecode::Int::TaskTraits< Cumulative::OptFlexTask >::UnaryTask
Unary::OptFlexTask UnaryTask
The corresponding unary task type.
Definition cumulative.hh:539
Gecode::Int::TaskTraits< Cumulative::OptFlexTask >::TaskViewBwd
Cumulative::OptFlexTaskBwd TaskViewBwd
The backward task view type.
Definition cumulative.hh:535
Gecode::Int::TaskTraits< Cumulative::OptFlexTask >::TaskViewFwd
Cumulative::OptFlexTaskFwd TaskViewFwd
The forward task view type.
Definition cumulative.hh:533
Gecode::Int::TaskTraits
Traits class for mapping tasks to task views.
Definition task.hh:157
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::n_nodes
int n_nodes(void) const
Definition tree.hpp:57
Gecode::Int::TaskTree< TaskView, OmegaNode >::tasks
const TaskViewArray< TaskView > & tasks
Definition task.hh:369
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::n_right
static int n_right(int i)
Definition tree.hpp:85
Gecode::Int::TaskTree< TaskView, OmegaNode >::TaskTree
TaskTree(Region &r, const TaskViewArray< TaskView > &t)
Definition tree.hpp:141
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::right
static bool right(int i)
Definition tree.hpp:90
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::n_left
static int n_left(int i)
Definition tree.hpp:73
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::left
static bool left(int i)
Definition tree.hpp:78
Gecode::Int::TaskTree< TaskView, OmegaNode >::init
void init(void)
Definition tree.hpp:115
Gecode::Int::TaskTree< TaskView, OmegaNode >::update
void update(int i, bool l=true)
Definition tree.hpp:129
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::node
ExtOmegaNode * node
Definition task.hh:371
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::n_leaf
bool n_leaf(int i) const
Definition tree.hpp:68
Gecode::Int::TaskTree< TaskView, OmegaNode >::root
const OmegaNode & root(void) const
Definition tree.hpp:109
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::n_parent
static int n_parent(int i)
Definition tree.hpp:97
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::_leaf
int * _leaf
Definition task.hh:373
Gecode::Int::TaskTree< TaskView, OmegaNode >::leaf
OmegaNode & leaf(int i)
Definition tree.hpp:103
Gecode::Int::TaskTree< TaskView, ExtOmegaNode >::n_root
static bool n_root(int i)
Definition tree.hpp:63
Gecode::Int::TaskViewArray
Task view array.
Definition task.hh:233
Gecode::Int::TaskViewTraits< Cumulative::ManFixPSETaskBwd >::Task
Cumulative::ManFixPSETask Task
The task type.
Definition cumulative.hh:396
Gecode::Int::TaskViewTraits< Cumulative::ManFixPSETaskFwd >::Task
Cumulative::ManFixPSETask Task
The task type.
Definition cumulative.hh:388
Gecode::Int::TaskViewTraits< Cumulative::ManFixPTaskBwd >::Task
Cumulative::ManFixPTask Task
The task type.
Definition cumulative.hh:380
Gecode::Int::TaskViewTraits< Cumulative::ManFixPTaskFwd >::Task
Cumulative::ManFixPTask Task
The task type.
Definition cumulative.hh:372
Gecode::Int::TaskViewTraits< Cumulative::ManFlexTaskBwd >::Task
Cumulative::ManFlexTask Task
The task type.
Definition cumulative.hh:444
Gecode::Int::TaskViewTraits< Cumulative::ManFlexTaskFwd >::Task
Cumulative::ManFlexTask Task
The task type.
Definition cumulative.hh:436
Gecode::Int::TaskViewTraits< Cumulative::OptFixPSETaskBwd >::Task
Cumulative::OptFixPSETask Task
The task type.
Definition cumulative.hh:428
Gecode::Int::TaskViewTraits< Cumulative::OptFixPSETaskFwd >::Task
Cumulative::OptFixPSETask Task
The task type.
Definition cumulative.hh:420
Gecode::Int::TaskViewTraits< Cumulative::OptFixPTaskBwd >::Task
Cumulative::OptFixPTask Task
The task type.
Definition cumulative.hh:412
Gecode::Int::TaskViewTraits< Cumulative::OptFixPTaskFwd >::Task
Cumulative::OptFixPTask Task
The task type.
Definition cumulative.hh:404
Gecode::Int::TaskViewTraits< Cumulative::OptFlexTaskBwd >::Task
Cumulative::OptFlexTask Task
The task type.
Definition cumulative.hh:460
Gecode::Int::TaskViewTraits< Cumulative::OptFlexTaskFwd >::Task
Cumulative::OptFlexTask Task
The task type.
Definition cumulative.hh:452
Gecode::Int::TaskViewTraits
Traits class for mapping task views to tasks.
Definition task.hh:148
Gecode::Int::Unary::ManFixPSETask
Unary (mandatory) task with fixed processing, start or end time
Definition unary.hh:148
Gecode::Int::Unary::ManFixPTask
Unary (mandatory) task with fixed processing time
Definition unary.hh:54
Gecode::Int::Unary::ManFlexTask
Unary (mandatory) task with flexible processing time
Definition unary.hh:270
Gecode::Int::Unary::ManFlexTask::p
IntVar p(void) const
Return processing time.
Definition task.hpp:359
Gecode::Int::Unary::OptFixPSETask
Unary optional task with fixed processing, start or end time.
Definition unary.hh:246
Gecode::Int::Unary::OptFixPTask
Unary optional task with fixed processing time
Definition unary.hh:222
Gecode::Int::Unary::OptFlexTask
Unary optional task with flexible processing time
Definition unary.hh:370
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation).
Definition core.hpp:1075
Gecode::Region
Handle to region.
Definition region.hpp:55
Gecode::Space
Computation spaces.
Definition core.hpp:1742
edge-finding.hpp
man-prop.hpp
opt-prop.hpp
overload.hpp
subsumption.hpp
task-view.hpp
task.hpp
time-tabling.hpp
tree.hpp
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::TaskType
TaskType
Type of task for scheduling constraints.
Definition int.hh:1004
Gecode::IntPropLevel
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:974
limits.hpp
post.hpp
Gecode::Int::Cumulative
Scheduling for cumulative resources
Definition cumulative.cpp:40
Gecode::Int::Cumulative::ManFlexTaskBwd
FwdToBwd< ManFlexTaskFwd > ManFlexTaskBwd
Backward (dual) mandatory flexible task view.
Definition cumulative.hh:320
Gecode::Int::Cumulative::ManFlexTaskFwd
ManFlexTask ManFlexTaskFwd
Forward mandatory flexible task view.
Definition cumulative.hh:317
Gecode::Int::Cumulative::ManFixPSETaskBwd
FwdToBwd< ManFixPSETaskFwd > ManFixPSETaskBwd
Backward (dual) mandatory fixed task view.
Definition cumulative.hh:302
Gecode::Int::Cumulative::timetabling
ExecStatus timetabling(Space &home, Propagator &p, Cap c, TaskArray< Task > &t)
Perform time-tabling propagation.
Definition time-tabling.hpp:55
Gecode::Int::Cumulative::cmanpost
ExecStatus cmanpost(Home home, Cap c, TaskArray< ManTask > &t, IntPropLevel ipl)
Post mandatory task propagator according to propagation level.
Gecode::Int::Cumulative::OptFlexTaskFwd
OptFlexTask OptFlexTaskFwd
Forward optional flexible task view.
Definition cumulative.hh:323
Gecode::Int::Cumulative::OptFixPTaskBwd
FwdToBwd< OptFixPTaskFwd > OptFixPTaskBwd
Backward (dual) optional fixed task view.
Definition cumulative.hh:308
Gecode::Int::Cumulative::OptFlexTaskBwd
FwdToBwd< OptFlexTaskFwd > OptFlexTaskBwd
Backward (dual) optional flexible task view.
Definition cumulative.hh:326
Gecode::Int::Cumulative::OptFixPTaskFwd
OptFixPTask OptFixPTaskFwd
Forward optional fixed task view.
Definition cumulative.hh:305
Gecode::Int::Cumulative::OptFixPSETaskBwd
FwdToBwd< OptFixPSETaskFwd > OptFixPSETaskBwd
Backward (dual) optional fixed task view.
Definition cumulative.hh:314
Gecode::Int::Cumulative::mul_check
void mul_check(long long int x, long long int y)
Throw exception if multiplication of x and y overflows.
Definition limits.hpp:37
Gecode::Int::Cumulative::coptpost
ExecStatus coptpost(Home home, Cap c, TaskArray< OptTask > &t, IntPropLevel ipl)
Post optional task propagator according to propagation level.
Gecode::Int::Cumulative::ManFixPTaskBwd
FwdToBwd< ManFixPTaskFwd > ManFixPTaskBwd
Backward (dual) mandatory fixed task view.
Definition cumulative.hh:296
Gecode::Int::Cumulative::ManFixPSETaskFwd
ManFixPSETask ManFixPSETaskFwd
Forward mandatory fixed task view.
Definition cumulative.hh:299
Gecode::Int::Cumulative::subsumed
ExecStatus subsumed(Space &home, Propagator &p, int c, TaskArray< Task > &t)
Check for subsumption (all tasks must be assigned).
Definition subsumption.hpp:38
Gecode::Int::Cumulative::ManFixPTaskFwd
ManFixPTask ManFixPTaskFwd
Forward mandatory fixed task view.
Definition cumulative.hh:293
Gecode::Int::Cumulative::operator<<
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const ManFixPTaskBwd &t)
Definition task-view.hpp:40
Gecode::Int::Cumulative::OptFixPSETaskFwd
OptFixPSETask OptFixPSETaskFwd
Forward optional fixed task view.
Definition cumulative.hh:311
Gecode::Int::Cumulative::edgefinding
ExecStatus edgefinding(Space &home, int c, TaskArray< Task > &t)
Propagate by edge-finding.
Definition edge-finding.hpp:178
Gecode::Int::Cumulative::overload
ExecStatus overload(Space &home, int c, TaskArray< ManTask > &t)
Check mandatory tasks t for overload.
Definition overload.hpp:41
Gecode::Int
Finite domain integers.
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
task.hh
unary.hh