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
00299 class ValCommitInc : public ValCommit<SetView,int> {
00300 public:
00302 ValCommitInc(Space& home, const ValBranch& vb);
00304 ValCommitInc(Space& home, bool shared, ValCommitInc& vc);
00306 ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
00307 };
00308
00315 class ValCommitExc : public ValCommit<SetView,int> {
00316 public:
00318 ValCommitExc(Space& home, const ValBranch& vb);
00320 ValCommitExc(Space& home, bool shared, ValCommitExc& vc);
00322 ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
00323 };
00324
00325 }}}
00326
00327 #include <gecode/set/branch/val-commit.hpp>
00328
00329 namespace Gecode { namespace Set { namespace Branch {
00330
00332 GECODE_SET_EXPORT
00333 ValSelCommitBase<SetView,int>*
00334 valselcommit(Space& home, const SetValBranch& svb);
00335
00337 GECODE_SET_EXPORT
00338 ValSelCommitBase<SetView,int>*
00339 valselcommit(Space& home, const SetAssign& ia);
00340
00341 }}}
00342
00343 #endif
00344
00345
00346