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
00039
00040
00041
00042
00043
00044 #ifndef __GECODE_SET_BRANCH_HH__
00045 #define __GECODE_SET_BRANCH_HH__
00046
00047 #include <gecode/set.hh>
00048
00054 namespace Gecode { namespace Set { namespace Branch {
00055
00074 class MeritMin : public MeritBase<SetView,int> {
00075 public:
00077 MeritMin(Space& home, const VarBranch<Var>& vb);
00079 MeritMin(Space& home, bool shared, MeritMin& m);
00081 int operator ()(const Space& home, SetView x, int i);
00082 };
00083
00090 class MeritMax : public MeritBase<SetView,int> {
00091 public:
00093 MeritMax(Space& home, const VarBranch<Var>& vb);
00095 MeritMax(Space& home, bool shared, MeritMax& m);
00097 int operator ()(const Space& home, SetView x, int i);
00098 };
00099
00106 class MeritSize : public MeritBase<SetView,unsigned int> {
00107 public:
00109 MeritSize(Space& home, const VarBranch<Var>& vb);
00111 MeritSize(Space& home, bool shared, MeritSize& m);
00113 unsigned int operator ()(const Space& home, SetView x, int i);
00114 };
00115
00122 class MeritDegreeSize : public MeritBase<SetView,double> {
00123 public:
00125 MeritDegreeSize(Space& home, const VarBranch<Var>& vb);
00127 MeritDegreeSize(Space& home, bool shared, MeritDegreeSize& m);
00129 double operator ()(const Space& home, SetView x, int i);
00130 };
00131
00138 class MeritAFCSize : public MeritBase<SetView,double> {
00139 protected:
00141 AFC afc;
00142 public:
00144 MeritAFCSize(Space& home, const VarBranch<Var>& vb);
00146 MeritAFCSize(Space& home, bool shared, MeritAFCSize& m);
00148 double operator ()(const Space& home, SetView x, int i);
00150 bool notice(void) const;
00152 void dispose(Space& home);
00153 };
00154
00161 class MeritActionSize : public MeritBase<SetView,double> {
00162 protected:
00164 Action action;
00165 public:
00167 MeritActionSize(Space& home, const VarBranch<Var>& vb);
00169 MeritActionSize(Space& home, bool shared, MeritActionSize& m);
00171 double operator ()(const Space& home, SetView x, int i);
00173 bool notice(void) const;
00175 void dispose(Space& home);
00176 };
00177
00184 class MeritCHBSize : public MeritBase<SetView,double> {
00185 protected:
00187 CHB chb;
00188 public:
00190 MeritCHBSize(Space& home, const VarBranch<Var>& vb);
00192 MeritCHBSize(Space& home, bool shared, MeritCHBSize& m);
00194 double operator ()(const Space& home, SetView x, int i);
00196 bool notice(void) const;
00198 void dispose(Space& home);
00199 };
00200
00201 }}}
00202
00203 #include <gecode/set/branch/merit.hpp>
00204
00205 namespace Gecode { namespace Set { namespace Branch {
00206
00208 GECODE_SET_EXPORT
00209 ViewSel<SetView>* viewsel(Space& home, const SetVarBranch& svb);
00210
00211 }}}
00212
00213 namespace Gecode { namespace Set { namespace Branch {
00214
00233 class ValSelMin : public ValSel<SetView,int> {
00234 public:
00236 ValSelMin(Space& home, const ValBranch<Var>& vb);
00238 ValSelMin(Space& home, bool shared, ValSelMin& vs);
00240 int val(const Space& home, SetView x, int i);
00241 };
00242
00249 class ValSelMax : public ValSel<SetView,int> {
00250 public:
00252 ValSelMax(Space& home, const ValBranch<Var>& vb);
00254 ValSelMax(Space& home, bool shared, ValSelMax& vs);
00256 int val(const Space& home, SetView x, int i);
00257 };
00258
00265 class ValSelMed : public ValSel<SetView,int> {
00266 public:
00268 ValSelMed(Space& home, const ValBranch<Var>& vb);
00270 ValSelMed(Space& home, bool shared, ValSelMed& vs);
00272 int val(const Space& home, SetView x, int i);
00273 };
00274
00281 class ValSelRnd : public ValSel<SetView,int> {
00282 protected:
00284 Rnd r;
00285 public:
00287 ValSelRnd(Space& home, const ValBranch<Var>& vb);
00289 ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
00291 int val(const Space& home, SetView x, int i);
00293 bool notice(void) const;
00295 void dispose(Space& home);
00296 };
00297
00298 }}}
00299
00300 #include <gecode/set/branch/val-sel.hpp>
00301
00302 namespace Gecode { namespace Set { namespace Branch {
00303
00305 class IncNGL : public ViewValNGL<SetView,int,PC_SET_ANY> {
00306 public:
00308 IncNGL(Space& home, SetView x, int n);
00310 IncNGL(Space& home, bool share, IncNGL& ngl);
00312 GECODE_SET_EXPORT
00313 virtual NGL::Status status(const Space& home) const;
00315 GECODE_SET_EXPORT
00316 virtual ExecStatus prune(Space& home);
00318 GECODE_SET_EXPORT
00319 virtual NGL* copy(Space& home, bool share);
00320 };
00321
00323 class ExcNGL : public ViewValNGL<SetView,int,PC_SET_ANY> {
00324 public:
00326 ExcNGL(Space& home, SetView x, int n);
00328 ExcNGL(Space& home, bool share, ExcNGL& ngl);
00330 GECODE_SET_EXPORT
00331 virtual NGL::Status status(const Space& home) const;
00333 GECODE_SET_EXPORT
00334 virtual ExecStatus prune(Space& home);
00336 GECODE_SET_EXPORT
00337 virtual NGL* copy(Space& home, bool share);
00338 };
00339
00340 }}}
00341
00342 #include <gecode/set/branch/ngl.hpp>
00343
00344 namespace Gecode { namespace Set { namespace Branch {
00345
00364 class ValCommitInc : public ValCommit<SetView,int> {
00365 public:
00367 ValCommitInc(Space& home, const ValBranch<Var>& vb);
00369 ValCommitInc(Space& home, bool shared, ValCommitInc& vc);
00371 ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
00373 NGL* ngl(Space& home, unsigned int a, View x, int n) const;
00375 void print(const Space& home, unsigned int a, SetView x, int i, int n,
00376 std::ostream& o) const;
00377 };
00378
00385 class ValCommitExc : public ValCommit<SetView,int> {
00386 public:
00388 ValCommitExc(Space& home, const ValBranch<Var>& vb);
00390 ValCommitExc(Space& home, bool shared, ValCommitExc& vc);
00392 ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
00394 NGL* ngl(Space& home, unsigned int a, View x, int n) const;
00396 void print(const Space& home, unsigned int a, SetView x, int i, int n,
00397 std::ostream& o) const;
00398 };
00399
00400 }}}
00401
00402 #include <gecode/set/branch/val-commit.hpp>
00403
00404 namespace Gecode { namespace Set { namespace Branch {
00405
00407 GECODE_SET_EXPORT
00408 ValSelCommitBase<SetView,int>*
00409 valselcommit(Space& home, const SetValBranch& svb);
00410
00412 GECODE_SET_EXPORT
00413 ValSelCommitBase<SetView,int>*
00414 valselcommit(Space& home, const SetAssign& ia);
00415
00416 }}}
00417
00418 #endif
00419
00420
00421