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
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 namespace Gecode { namespace Int { namespace Cumulatives {
00047
00092 template <class ViewM, class ViewD, class ViewH, class View>
00093 class Val : public Propagator {
00094 protected:
00095 ViewArray<ViewM> machine;
00096 ViewArray<View> start;
00097 ViewArray<ViewD> duration;
00098 ViewArray<View> end;
00099 ViewArray<ViewH> height;
00100 SharedArray<int> limit;
00101 const bool at_most;
00102
00103 Val(Space& home, bool share, Val<ViewM, ViewD, ViewH, View>& p);
00104 Val(Space& home, const ViewArray<ViewM>&, const ViewArray<View>&,
00105 const ViewArray<ViewD>&, const ViewArray<View>&,
00106 const ViewArray<ViewH>&, const SharedArray<int>&, bool);
00107
00108 ExecStatus prune(Space& home, int low, int up, int r,
00109 int ntask, int sheight,
00110 int* contribution,
00111 int* prune_tasks, int& prune_tasks_size);
00112 public:
00114 virtual Actor* copy(Space& home, bool share);
00116 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00118 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00120 static ExecStatus post(Space& home, const ViewArray<ViewM>&,
00121 const ViewArray<View>&, const ViewArray<ViewD>&,
00122 const ViewArray<View>&, const ViewArray<ViewH>&,
00123 const SharedArray<int>&, bool);
00125 virtual size_t dispose(Space& home);
00126 };
00127
00128
00129 }}}
00130
00131 #include <gecode/int/cumulatives/val.hpp>
00132
00133 #endif
00134
00135
00136