00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GC_LATTICENEIGHBORED2_HH_
00021 #define GC_LATTICENEIGHBORED2_HH_
00022
00023 #include <gecode/kernel.hh>
00024 #include <gecode/int.hh>
00025 #include <gecode/search.hh>
00026
00027 #include <biu/LatticeFrame.hh>
00028
00029 namespace cpsp
00030 {
00031 namespace gecode
00032 {
00033
00034 typedef Gecode::BinaryPropagator< Gecode::Int::IntView,
00035 Gecode::Int::PC_INT_DOM> GC_BinProp;
00036
00037 class GC_LatticeNeighbored2 : public GC_BinProp
00038
00039 {
00040 private:
00041
00042
00043 biu::IndexSet& getIndexedNeighbors(
00044 const biu::LatticeFrame::index_type center, biu::IndexSet& toFill) const ;
00045
00047 Gecode::ModEvent removeNonNeighbors( Gecode::Space* home,
00048 Gecode::Int::IntView& x,
00049 int center);
00052 Gecode::ModEvent removeNonNeighbors(Gecode::Space* home);
00053
00055 static const unsigned int MAXPROPSIZEINIT;
00056
00057
00058 protected:
00059
00060 using GC_BinProp::x0;
00061 using GC_BinProp::x1;
00062
00064 const biu::IndexVec * neighborhood;
00065
00070 Gecode::IntConLevel conLevel;
00071
00074 unsigned int maxPropSize;
00075
00078 bool maxPropSizeBin;
00079
00082 unsigned int minPropSize;
00083
00085 bool cancelProp;
00086
00088 GC_LatticeNeighbored2(Gecode::Space* home, bool share, GC_LatticeNeighbored2& p);
00089
00091 GC_LatticeNeighbored2( Gecode::Space* home,
00092 Gecode::Int::IntView x0,
00093 Gecode::Int::IntView x1,
00094 const biu::IndexVec * indexedNeighVecs,
00095 Gecode::IntConLevel conLvl,
00096 unsigned int maxPrSize,
00097 bool maxPrSizeBin,
00098 unsigned int minPrSize);
00099
00100 public:
00102 static Gecode::ExecStatus post( Gecode::Space* home,
00103 Gecode::Int::IntView x0,
00104 Gecode::Int::IntView x1,
00105 const biu::IndexVec * indexedNeighVecs,
00106 Gecode::IntConLevel conLvl =Gecode::ICL_BND,
00107 unsigned int maxPrSize = MAXPROPSIZEINIT,
00108 bool maxPrSizeBin = false,
00109 unsigned int minPrSize = 0);
00110
00112 virtual Gecode::Actor* copy(Gecode::Space* home, bool share);
00113
00115 virtual Gecode::PropCost cost(void) const;
00116
00118 virtual Gecode::ExecStatus propagate(Gecode::Space* home);
00119
00120 };
00121
00122 }
00123 }
00124
00125 #endif
00126