propagator.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 #ifndef __GECODE_GENERATOR_PROJECOTRS_HH
00039 #define __GECODE_GENERATOR_PROJECTORS_HH
00040
00041 #include "gecode/set/projectors.hh"
00042
00048 namespace Gecode { namespace Set { namespace Projection {
00049
00053 template <bool negated>
00054 class NaryProjection : public Propagator {
00055 protected:
00057 ViewArray<SetView> x;
00059 SharedArray<PropCond> pc;
00061 ProjectorSet ps;
00063 NaryProjection(Space* home, bool share, NaryProjection& p);
00065 NaryProjection(Space* home, ViewArray<SetView>& x, ProjectorSet& ps);
00066 public:
00068 virtual PropCost cost(ModEventDelta med) const;
00070 virtual size_t dispose(Space* home);
00072 virtual Actor* copy(Space* home,bool);
00074 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00076 GECODE_SET_EXPORT
00077 virtual Reflection::ActorSpec spec(const Space* home,
00078 Reflection::VarMap& m) const;
00080 static Support::Symbol ati(void);
00081 static ExecStatus post(Space* home, ViewArray<SetView>& x,
00082 ProjectorSet& ps);
00083 };
00084
00088 class ReNaryProjection : public Propagator {
00089 protected:
00091 ViewArray<SetView> x;
00093 Gecode::Int::BoolView b;
00095 ProjectorSet ps;
00097 ReNaryProjection(Space* home, bool share, ReNaryProjection& p);
00099 ReNaryProjection(Space* home,ViewArray<SetView>& x,
00100 Gecode::Int::BoolView,
00101 ProjectorSet& ps);
00102 public:
00104 virtual PropCost cost(ModEventDelta med) const;
00106 GECODE_SET_EXPORT virtual size_t dispose(Space* home);
00108 GECODE_SET_EXPORT virtual Actor* copy(Space* home,bool);
00110 GECODE_SET_EXPORT virtual ExecStatus propagate(Space* home, ModEventDelta med);
00112 GECODE_SET_EXPORT
00113 virtual Reflection::ActorSpec spec(const Space* home,
00114 Reflection::VarMap& m) const;
00116 static Support::Symbol ati(void);
00117 GECODE_SET_EXPORT static ExecStatus post(Space* home,
00118 ViewArray<SetView>& x,
00119 Gecode::Int::BoolView b,
00120 ProjectorSet& ps);
00121 };
00122
00126 class CardProjection : public Propagator {
00127 protected:
00129 ViewArray<SetView> x;
00131 Gecode::Int::IntView i;
00133 SharedArray<PropCond> pc;
00135 Projector proj;
00137 CardProjection(Space* home, bool share, CardProjection& p);
00139 CardProjection(Space* home, ViewArray<SetView>& x,
00140 Gecode::Int::IntView i, Projector& ps);
00141 public:
00143 virtual PropCost cost(ModEventDelta med) const;
00145 virtual size_t dispose(Space* home);
00147 virtual Actor* copy(Space* home,bool);
00149 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00151 GECODE_SET_EXPORT
00152 virtual Reflection::ActorSpec spec(const Space* home,
00153 Reflection::VarMap& m) const;
00155 static Support::Symbol ati(void);
00156 static ExecStatus post(Space* home, ViewArray<SetView>& x,
00157 Gecode::Int::IntView i, Projector& p);
00158 };
00159
00160 }}}
00161
00162 #include "gecode/set/projectors/propagator/nary.icc"
00163 #include "gecode/set/projectors/propagator/re-nary.icc"
00164 #include "gecode/set/projectors/propagator/card.icc"
00165
00166 #endif
00167
00168