117 inline IntBoolVarBranch
121 inline IntBoolVarBranch
125 inline IntBoolVarBranch
129 inline IntBoolVarBranch
133 inline IntBoolVarBranch
137 inline IntBoolVarBranch
141 inline IntBoolVarBranch
145 inline IntBoolVarBranch
149 inline IntBoolVarBranch
153 inline IntBoolVarBranch
157 inline IntBoolVarBranch
166 :
iafc(ibvb.intafc()),
bafc(ibvb.boolafc()) {}
187 :
iafc(ibvb.intafc()),
bafc(ibvb.boolafc()) {}
193 return x.afc() /
x.size();
197 return x.afc() / 2.0;
250 :
ichb(ibvb.intchb()),
bchb(ibvb.boolchb()) {}
271 :
ichb(ibvb.intchb()),
bchb(ibvb.boolchb()) {}
277 return ichb[i] /
x.size();
281 return bchb[i] / 2.0;
292 :
Choice(b,a), _pos(p), _val(n) {}
333 template<
class Merit>
344 template<
class Merit>
356 template<
class Merit>
363 template<
class Merit>
369 template<
class Merit>
375 assert(!
x[p].assigned());
377 for (
int i=p+1; i<
x.size(); i++)
378 if (!
x[i].assigned()) {
379 double mi =
merit(
x[i],i);
384 for (
int i=0; i<
y.size(); i++)
385 if (!
y[i].assigned()) {
386 double mi =
merit(
y[i],i);
392 assert(!
y[p-
x.size()].assigned());
394 for (
int i=p-
x.size()+1; i<
y.size(); i++)
395 if (!
y[i].assigned()) {
396 double mi =
merit(
y[i],i);
404 v=
xvsc->val(home,
x[p],p);
406 v=
yvsc->val(home,
y[p-
x.size()],p-
x.size());
411 template<
class Merit>
Base-class for both propagators and branchers.
virtual Actor * copy(Space &home)=0
Create copy.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Recording AFC information for Boolean variables.
Recording actions for Boolean variables.
Recording CHB for Boolean variables.
Which values to select for branching first.
Passing Boolean variables.
Base-class for branchers.
Brancher(Home home)
Constructor for creation.
Choice for performing commit
Choice(const Brancher &b, const unsigned int a)
Initialize for particular brancher b and alternatives a.
Base-class for brancher for integer and Boolean views.
ViewArray< Int::BoolView > y
Boolean views to branch on.
ViewArray< Int::IntView > x
Integer views to branch on.
IntBoolBrancherBase(Space &home, IntBoolBrancherBase &b)
Constructor for cloning b.
ValSelCommitBase< Int::BoolView, int > * yvsc
Boolean value selection and commit object.
ValSelCommitBase< Int::IntView, int > * xvsc
Integer value selection and commit object.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
int start
Unassigned views start here (might be in x or y)
Brancher for integer and Boolean views.
virtual const Choice * choice(Space &home)
Return choice.
virtual Actor * copy(Space &home)
Perform cloning.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
Merit merit
Selection by maximal merit.
IntBoolBrancher(Space &home, IntBoolBrancher &b)
Constructor for cloning b.
static void post(Home home, ViewArray< Int::IntView > x, ViewArray< Int::BoolView > y, Merit &m, ValSelCommitBase< Int::IntView, int > *xvsc, ValSelCommitBase< Int::BoolView, int > *yvsc)
Post brancher.
Which integer or Boolean variable to select for branching.
BoolCHB boolchb(void) const
Return Boolean AFC.
IntCHB intchb(void) const
Return integer CHB.
void expand(Home home, const IntVarArgs &x, const BoolVarArgs &y)
Expand AFC, action, and CHB.
Select s
Which variable to select.
IntBoolVarBranch(Select s, double d)
Initialize with selection strategy s and decay factor d.
IntAction intaction(void) const
Return integer action.
IntAFC intafc(void) const
Return integer AFC.
BoolAFC boolafc(void) const
Return Boolean AFC.
BoolAction boolaction(void) const
Return Boolean action.
Select select(void) const
Return selection strategy.
BoolAction baction
Boolean action.
IntAction iaction
Integer action.
Select
Which variable selection.
@ SEL_ACTION_SIZE_MAX
With largest action divided by domain size.
@ SEL_CHB_SIZE_MAX
With largest CHB Q-score divided by domain size.
@ SEL_ACTION_MAX
With highest action.
@ SEL_AFC_MAX
With largest accumulated failure count.
@ SEL_CHB_MAX
With highest CHB Q-score.
@ SEL_AFC_SIZE_MAX
With largest accumulated failure count divided by domain size.
IntAFC iafc
Integer AFC information.
double operator()(Int::IntView x, int i) const
Return merit.
BoolAFC bafc
Boolean AFC information.
MeritMaxAFCSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
void dispose(void)
Dispose.
MeritMaxAFC(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
void dispose(void)
Dispose.
double operator()(Int::IntView x, int i) const
Return merit.
BoolAFC bafc
Boolean AFC information.
IntAFC iafc
Integer AFC information.
void dispose(void)
Dispose.
double operator()(Int::IntView x, int i) const
Return merit.
BoolAction baction
Boolean Action information.
MeritMaxActionSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
IntAction iaction
Integer Action information.
void dispose(void)
Dispose.
double operator()(Int::IntView x, int i) const
Return merit.
BoolAction baction
Boolean Action information.
MeritMaxAction(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
IntAction iaction
Integer Action information.
BoolCHB bchb
Boolean CHB information.
void dispose(void)
Dispose.
IntCHB ichb
Integer CHB information.
MeritMaxCHBSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
double operator()(Int::IntView x, int i) const
Return merit.
double operator()(Int::IntView x, int i) const
Return merit.
void dispose(void)
Dispose.
MeritMaxCHB(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
BoolCHB bchb
Boolean CHB information.
IntCHB ichb
Integer CHB information.
Choice storing position and value
int pos(void) const
Return position of view to assign.
int val(void) const
Return value to assign to.
PosIntChoice(const Brancher &b, unsigned int a, int p, int n)
Initialize choice for brancher b, number of alternatives a, position p, and value n.
FloatValImpType x
Implementation of float value.
Home class for posting propagators
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Recording AFC information for integer variables.
Recording actions for integer variables.
Recording CHB for integer variables.
Which values to select for branching first.
@ SEL_RND
Select random value.
@ SEL_SPLIT_MAX
Select values greater than mean of smallest and largest value.
@ SEL_MIN
Select smallest value.
@ SEL_MAX
Select largest value.
@ SEL_RANGE_MAX
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
@ SEL_RANGE_MIN
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
@ SEL_MED
Select greatest value not greater than the median.
@ SEL_SPLIT_MIN
Select values not greater than mean of smallest and largest value.
Select select(void) const
Return selection strategy.
Passing integer variables.
Boolean view for Boolean variables.
Integer view for integer variables.
Rnd rnd(void) const
Return random number generator.
Base class for value selection and commit.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
@ AP_DISPOSE
Actor must always be disposed.
Interpreter for the FlatZinc language.
IntBoolVarBranch INTBOOL_VAR_CHB_SIZE_MAX(double d=1.0)
Select variable with largest CHB Q-score divided by domain size.
IntBoolVarBranch INTBOOL_VAR_CHB_MAX(double d=1.0)
Select variable with largest CHB Q-score.
IntBoolVarBranch INTBOOL_VAR_ACTION_MAX(double d=1.0)
Select variable with highest action.
BoolValBranch i2b(const IntValBranch &ivb)
Map respective integer value selection to Boolean value selection.
IntBoolVarBranch INTBOOL_VAR_AFC_SIZE_MAX(double d=1.0)
Select variable with largest accumulated failure count divided by domain size.
IntBoolVarBranch INTBOOL_VAR_ACTION_SIZE_MAX(double d=1.0)
Select variable with largest action divided by domain size.
IntBoolVarBranch INTBOOL_VAR_AFC_MAX(double d=1.0)
Variable selection for both integer and Boolean variables.
Gecode toplevel namespace
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Post propagator for SetVar SetOpType SetVar y
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Post propagator for SetVar x
#define GECODE_NEVER
Assert that this command is never executed.