Generated on Mon Aug 25 11:35:36 2008 for Gecode by doxygen 1.5.6

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-08-01 18:01:23 +0200 (Fri, 01 Aug 2008) $ by $Author: zayenz $
00011  *     $Revision: 7482 $
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 namespace Gecode { namespace Int { namespace Cumulatives {
00047 
00092   template <class ViewM, class ViewD, class ViewH, class View>
00093   class Val : public Propagator {
00094     ViewArray<ViewM>  machine;
00095     ViewArray<View>   start;
00096     ViewArray<ViewD>  duration;
00097     ViewArray<View>   end;
00098     ViewArray<ViewH>  height;
00099     SharedArray<int>  limit;
00100     const bool        at_most;
00101 
00102     Val(Space* home, bool share, Val<ViewM, ViewD, ViewH, View>& p);
00103     Val(Space* home, const ViewArray<ViewM>&, const ViewArray<View>&,
00104         const ViewArray<ViewD>&, const ViewArray<View>&,
00105         const ViewArray<ViewH>&, const IntArgs&, bool);
00106 
00107     ExecStatus prune(Space * home, int low, int up, int r,
00108                      int ntask, int sheight,
00109                      int* contribution,
00110                      int* prune_tasks, int& prune_tasks_size);
00111   public:
00112     virtual size_t dispose(Space* home);
00113     virtual Actor*     copy(Space* home, bool share);
00114     virtual PropCost   cost(ModEventDelta med) const;
00115     virtual ExecStatus propagate(Space* home, ModEventDelta med);
00117     virtual Reflection::ActorSpec spec(const Space* home,
00118                                         Reflection::VarMap& m) const;
00120     static void post(Space* home, Reflection::VarMap& vars,
00121                      const Reflection::ActorSpec& spec);
00123     static Support::Symbol ati(void);
00124     static  ExecStatus post(Space* home, const ViewArray<ViewM>&,
00125                             const ViewArray<View>&, const ViewArray<ViewD>&,
00126                             const ViewArray<View>&, const ViewArray<ViewH>&,
00127                             const IntArgs&, bool);
00128   };
00129 
00130 
00131 }}}
00132 
00133 #include "gecode/int/cumulatives/val.icc"
00134 
00135 #endif
00136 
00137 // STATISTICS: int-prop
00138