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& 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& 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& 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& 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& 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 MeritActivitySize : public MeritBase<SetView,double> {
00162 protected:
00164 Activity activity;
00165 public:
00167 MeritActivitySize(Space& home, const VarBranch& vb);
00169 MeritActivitySize(Space& home, bool shared, MeritActivitySize& m);
00171 double operator ()(const Space& home, SetView x, int i);
00173 bool notice(void) const;
00175 void dispose(Space& home);
00176 };
00177
00178 }}}
00179
00180 #include <gecode/set/branch/merit.hpp>
00181
00182 namespace Gecode { namespace Set { namespace Branch {
00183
00185 GECODE_SET_EXPORT
00186 ViewSel<SetView>* viewsel(Space& home, const SetVarBranch& svb);
00187
00188 }}}
00189
00190 namespace Gecode { namespace Set { namespace Branch {
00191
00210 class ValSelMin : public ValSel<SetView,int> {
00211 public:
00213 ValSelMin(Space& home, const ValBranch& vb);
00215 ValSelMin(Space& home, bool shared, ValSelMin& vs);
00217 int val(const Space& home, SetView x, int i);
00218 };
00219
00226 class ValSelMax : public ValSel<SetView,int> {
00227 public:
00229 ValSelMax(Space& home, const ValBranch& vb);
00231 ValSelMax(Space& home, bool shared, ValSelMax& vs);
00233 int val(const Space& home, SetView x, int i);
00234 };
00235
00242 class ValSelMed : public ValSel<SetView,int> {
00243 public:
00245 ValSelMed(Space& home, const ValBranch& vb);
00247 ValSelMed(Space& home, bool shared, ValSelMed& vs);
00249 int val(const Space& home, SetView x, int i);
00250 };
00251
00258 class ValSelRnd : public ValSel<SetView,int> {
00259 protected:
00261 Rnd r;
00262 public:
00264 ValSelRnd(Space& home, const ValBranch& vb);
00266 ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
00268 int val(const Space& home, SetView x, int i);
00270 bool notice(void) const;
00272 void dispose(Space& home);
00273 };
00274
00275 }}}
00276
00277 #include <gecode/set/branch/val-sel.hpp>
00278
00279 namespace Gecode { namespace Set { namespace Branch {
00280
00282 class IncNGL : public ViewValNGL<SetView,int,PC_SET_ANY> {
00283 public:
00285 IncNGL(Space& home, SetView x, int n);
00287 IncNGL(Space& home, bool share, IncNGL& ngl);
00289 GECODE_SET_EXPORT
00290 virtual NGL::Status status(const Space& home) const;
00292 GECODE_SET_EXPORT
00293 virtual ExecStatus prune(Space& home);
00295 GECODE_SET_EXPORT
00296 virtual NGL* copy(Space& home, bool share);
00297 };
00298
00300 class ExcNGL : public ViewValNGL<SetView,int,PC_SET_ANY> {
00301 public:
00303 ExcNGL(Space& home, SetView x, int n);
00305 ExcNGL(Space& home, bool share, ExcNGL& ngl);
00307 GECODE_SET_EXPORT
00308 virtual NGL::Status status(const Space& home) const;
00310 GECODE_SET_EXPORT
00311 virtual ExecStatus prune(Space& home);
00313 GECODE_SET_EXPORT
00314 virtual NGL* copy(Space& home, bool share);
00315 };
00316
00317 }}}
00318
00319 #include <gecode/set/branch/ngl.hpp>
00320
00321 namespace Gecode { namespace Set { namespace Branch {
00322
00341 class ValCommitInc : public ValCommit<SetView,int> {
00342 public:
00344 ValCommitInc(Space& home, const ValBranch& vb);
00346 ValCommitInc(Space& home, bool shared, ValCommitInc& vc);
00348 ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
00350 NGL* ngl(Space& home, unsigned int a, View x, int n) const;
00352 void print(const Space& home, unsigned int a, SetView x, int i, int n,
00353 std::ostream& o) const;
00354 };
00355
00362 class ValCommitExc : public ValCommit<SetView,int> {
00363 public:
00365 ValCommitExc(Space& home, const ValBranch& vb);
00367 ValCommitExc(Space& home, bool shared, ValCommitExc& vc);
00369 ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
00371 NGL* ngl(Space& home, unsigned int a, View x, int n) const;
00373 void print(const Space& home, unsigned int a, SetView x, int i, int n,
00374 std::ostream& o) const;
00375 };
00376
00377 }}}
00378
00379 #include <gecode/set/branch/val-commit.hpp>
00380
00381 namespace Gecode { namespace Set { namespace Branch {
00382
00384 GECODE_SET_EXPORT
00385 ValSelCommitBase<SetView,int>*
00386 valselcommit(Space& home, const SetValBranch& svb);
00387
00389 GECODE_SET_EXPORT
00390 ValSelCommitBase<SetView,int>*
00391 valselcommit(Space& home, const SetAssign& ia);
00392
00393 }}}
00394
00395 #endif
00396
00397
00398