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 "int.hh"
00029
00030 #include "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 const bool cd_option;
00090
00091 Val(Space* home, bool share, Val<ViewM, ViewD, ViewH, View>& p);
00092 Val(Space* home, const ViewArray<ViewM>&, const ViewArray<View>&,
00093 const ViewArray<ViewD>&, const ViewArray<View>&,
00094 const ViewArray<ViewH>&, const IntArgs&, bool);
00095
00096 ExecStatus prune(Space * home, int low, int up, int r,
00097 int ntask, int sheight,
00098 const std::vector<int>& contribution,
00099 std::list<int>& prune_tasks);
00100 public:
00101 virtual ~Val(void);
00102 virtual Actor* copy(Space* home, bool share);
00103 virtual PropCost cost(void) const;
00104 virtual ExecStatus propagate(Space* home);
00105 static ExecStatus post(Space* home, const ViewArray<ViewM>&,
00106 const ViewArray<View>&, const ViewArray<ViewD>&,
00107 const ViewArray<View>&, const ViewArray<ViewH>&,
00108 const IntArgs&, bool);
00109 };
00110
00111
00112 }}}
00113
00114 #include "int/cumulatives/val.icc"
00115
00116 #endif
00117
00118
00119