Generated on Wed Jan 4 17:49:08 2006 for Gecode by doxygen 1.4.6

cumulatives.hh

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Mikael Lagerkvist <lagerkvist@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Mikael Lagerkvist, 2005
00007  *
00008  *  Last modified:
00009  *     $Date: 2005-08-09 17:26:38 +0200 (Tue, 09 Aug 2005) $ by $Author: schulte $
00010  *     $Revision: 2190 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
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 // STATISTICS: int-prop
00119