Generated on Wed Mar 19 07:29:57 2008 for Gecode by doxygen 1.5.5

cumulatives.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Mikael Lagerkvist <lagerkvist@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Mikael Lagerkvist, 2005
00008  *
00009  *  Last modified:
00010  *     $Date: 2008-01-29 13:37:51 +0100 (Tue, 29 Jan 2008) $ by $Author: tack $
00011  *     $Revision: 5993 $
00012  *
00013  *  This file is part of Gecode, the generic constraint
00014  *  development environment:
00015  *     http://www.gecode.org
00016  *
00017  *  Permission is hereby granted, free of charge, to any person obtaining
00018  *  a copy of this software and associated documentation files (the
00019  *  "Software"), to deal in the Software without restriction, including
00020  *  without limitation the rights to use, copy, modify, merge, publish,
00021  *  distribute, sublicense, and/or sell copies of the Software, and to
00022  *  permit persons to whom the Software is furnished to do so, subject to
00023  *  the following conditions:
00024  *
00025  *  The above copyright notice and this permission notice shall be
00026  *  included in all copies or substantial portions of the Software.
00027  *
00028  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00031  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00032  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00033  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00034  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 // STATISTICS: int-prop
00141