3
* Mikael Lagerkvist <lagerkvist@gecode.org>
6
* Mikael Lagerkvist, 2005
9
* $Date: 2005-08-09 17:26:38 +0200 (Tue, 09 Aug 2005) $ by $Author: schulte $
12
* This file is part of Gecode, the generic constraint
13
* development environment:
14
* http://www.gecode.org
16
* See the file "LICENSE" for information on usage and
17
* redistribution of this file, and for a
18
* DISCLAIMER OF ALL WARRANTIES.
25
#ifndef __GECODE_INT_CUMULATIVES_HH__
26
#define __GECODE_INT_CUMULATIVES_HH__
30
#include "support/shared-array.hh"
34
namespace Gecode { namespace Int { namespace Cumulatives {
36
/** \namespace Gecode::Int::Cumulatives
37
* \brief %Cumulatives propagators
39
* This namespace contains a propagator for the
40
* cumulatives constraint as presented in
42
@inproceedings{DBLP:conf/cp/BeldiceanuC02,
43
author = {Nicolas Beldiceanu and Mats Carlsson},
44
title = {A New Multi-resource cumulatives Constraint
45
with Negative Heights.},
49
ee = {http://link.springer.de/link/service/series/0558/
50
bibs/2470/24700063.htm},
51
crossref = {DBLP:conf/cp/2002},
52
bibsource = {DBLP, http://dblp.uni-trier.de}
54
@proceedings{DBLP:conf/cp/2002,
55
editor = {Pascal Van Hentenryck},
56
title = {Principles and Practice of Constraint Programming -
57
CP 2002, 8th International Conference, CP 2002,
58
Ithaca, NY, USA, September 9-13, 2002, Proceedings},
60
publisher = {Springer},
61
series = {Lecture Notes in Computer Science},
64
isbn = {3-540-44120-4},
65
bibsource = {DBLP, http://dblp.uni-trier.de}
72
* \brief %Propagator for the cumulatives constraint.
74
* This class implements Beldiceanu's and Carlsson's sweep-line
75
* propagation algorithm for the cumulatives constraint.
77
* Requires \code #include "int/cumulatives.hh" \endcode
78
* \ingroup FuncIntProp
80
template <class ViewM, class ViewD, class ViewH, class View>
81
class Val : public Propagator {
82
ViewArray<ViewM> machine;
83
ViewArray<View> start;
84
ViewArray<ViewD> duration;
86
ViewArray<ViewH> height;
87
Support::SharedArray<int> limit;
91
Val(Space* home, bool share, Val<ViewM, ViewD, ViewH, View>& p);
92
Val(Space* home, const ViewArray<ViewM>&, const ViewArray<View>&,
93
const ViewArray<ViewD>&, const ViewArray<View>&,
94
const ViewArray<ViewH>&, const IntArgs&, bool);
96
ExecStatus prune(Space * home, int low, int up, int r,
97
int ntask, int sheight,
98
const std::vector<int>& contribution,
99
std::list<int>& prune_tasks);
102
virtual Actor* copy(Space* home, bool share);
103
virtual PropCost cost(void) const;
104
virtual ExecStatus propagate(Space* home);
105
static ExecStatus post(Space* home, const ViewArray<ViewM>&,
106
const ViewArray<View>&, const ViewArray<ViewD>&,
107
const ViewArray<View>&, const ViewArray<ViewH>&,
108
const IntArgs&, bool);
114
#include "int/cumulatives/val.icc"
118
// STATISTICS: int-prop