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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef __GECODE_INT_CUMULATIVES_HH__
00042 #define __GECODE_INT_CUMULATIVES_HH__
00043
00044 #include "gecode/int.hh"
00045
00046 #include <vector>
00047 #include <list>
00048
00049 namespace Gecode { namespace Int { namespace Cumulatives {
00050
00095 template <class ViewM, class ViewD, class ViewH, class View>
00096 class Val : public Propagator {
00097 ViewArray<ViewM> machine;
00098 ViewArray<View> start;
00099 ViewArray<ViewD> duration;
00100 ViewArray<View> end;
00101 ViewArray<ViewH> height;
00102 SharedArray<int> limit;
00103 const bool at_most;
00104
00105 Val(Space* home, bool share, Val<ViewM, ViewD, ViewH, View>& p);
00106 Val(Space* home, const ViewArray<ViewM>&, const ViewArray<View>&,
00107 const ViewArray<ViewD>&, const ViewArray<View>&,
00108 const ViewArray<ViewH>&, const IntArgs&, bool);
00109
00110 ExecStatus prune(Space * home, int low, int up, int r,
00111 int ntask, int sheight,
00112 const std::vector<int>& contribution,
00113 std::list<int>& prune_tasks);
00114 public:
00115 virtual size_t dispose(Space* home);
00116 virtual Actor* copy(Space* home, bool share);
00117 virtual PropCost cost(ModEventDelta med) const;
00118 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00120 virtual Reflection::ActorSpec spec(const Space* home,
00121 Reflection::VarMap& m) const;
00123 static void post(Space* home, Reflection::VarMap& vars,
00124 const Reflection::ActorSpec& spec);
00126 static Support::Symbol ati(void);
00127 static ExecStatus post(Space* home, const ViewArray<ViewM>&,
00128 const ViewArray<View>&, const ViewArray<ViewD>&,
00129 const ViewArray<View>&, const ViewArray<ViewH>&,
00130 const IntArgs&, bool);
00131 };
00132
00133
00134 }}}
00135
00136 #include "gecode/int/cumulatives/val.icc"
00137
00138 #endif
00139
00140
00141