cumulatives.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __GECODE_INT_CUMULATIVES_HH__
00026 #define __GECODE_INT_CUMULATIVES_HH__
00027
00028 #include "gecode/int.hh"
00029
00030 #include "gecode/support/shared-array.hh"
00031 #include <vector>
00032 #include <list>
00033
00034 namespace Gecode { namespace Int { namespace Cumulatives {
00035
00080 template <class ViewM, class ViewD, class ViewH, class View>
00081 class Val : public Propagator {
00082 ViewArray<ViewM> machine;
00083 ViewArray<View> start;
00084 ViewArray<ViewD> duration;
00085 ViewArray<View> end;
00086 ViewArray<ViewH> height;
00087 Support::SharedArray<int> limit;
00088 const bool at_most;
00089
00090 Val(Space* home, bool share, Val<ViewM, ViewD, ViewH, View>& p);
00091 Val(Space* home, const ViewArray<ViewM>&, const ViewArray<View>&,
00092 const ViewArray<ViewD>&, const ViewArray<View>&,
00093 const ViewArray<ViewH>&, const IntArgs&, bool);
00094
00095 ExecStatus prune(Space * home, int low, int up, int r,
00096 int ntask, int sheight,
00097 const std::vector<int>& contribution,
00098 std::list<int>& prune_tasks);
00099 public:
00100 virtual size_t dispose(Space* home);
00101 virtual Actor* copy(Space* home, bool share);
00102 virtual PropCost cost(void) const;
00103 virtual ExecStatus propagate(Space* home);
00104 static ExecStatus post(Space* home, const ViewArray<ViewM>&,
00105 const ViewArray<View>&, const ViewArray<ViewD>&,
00106 const ViewArray<View>&, const ViewArray<ViewH>&,
00107 const IntArgs&, bool);
00108 };
00109
00110
00111 }}}
00112
00113 #include "gecode/int/cumulatives/val.icc"
00114
00115 #endif
00116
00117
00118