34 namespace Gecode {
namespace FlatZinc {
187 :
iafc(ibvb.intafc()),
bafc(ibvb.boolafc()) {}
197 return x.
afc() / 2.0;
208 : iaction(ibvb.intaction()), baction(ibvb.boolaction()) {}
250 : ichb(ibvb.intchb()), bchb(ibvb.boolchb()) {}
271 :
ichb(ibvb.intchb()),
bchb(ibvb.boolchb()) {}
281 return bchb[
i] / 2.0;
292 :
Choice(b,a), _pos(p), _val(n) {}
310 :
Brancher(home),
x(x0),
y(y0), start(0), xvsc(xvsc0), yvsc(yvsc0) {
333 template<
class Merit>
344 template<
class Merit>
356 template<
class Merit>
363 template<
class Merit>
369 template<
class Merit>
384 for (
int i=0;
i<
y.size();
i++)
392 assert(!
y[p-
x.
size()].assigned());
394 for (
int i=p-
x.
size()+1;
i<
y.size();
i++)
404 v=
xvsc->val(home,
x[p],p);
411 template<
class Merit>
BoolCHB boolchb(void) const
Return Boolean AFC.
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
double operator()(Int::IntView x, int i) const
Return merit.
BoolAction baction
Boolean action.
IntBoolVarBranch(Select s, double d)
Initialize with selection strategy s and decay factor d.
ValSelCommitBase< Int::IntView, int > * xvsc
Integer value selection and commit object.
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.
Merit merit
Selection by maximal merit.
With largest accumulated failure count.
IntBoolVarBranch INTBOOL_VAR_ACTION_SIZE_MAX(double d=1.0)
Select variable with largest action divided by domain size.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
IntCHB ichb
Integer CHB information.
Which values to select for branching first.
Actor must always be disposed.
IntCHB intchb(void) const
Return integer CHB.
Which values to select for branching first.
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...
void dispose(void)
Dispose.
IntAFC iafc
Integer AFC information.
Rnd rnd(void) const
Return random number generator.
double operator()(Int::IntView x, int i) const
Return merit.
void dispose(void)
Dispose.
unsigned int size(void) const
Return size (cardinality) of domain.
virtual Actor * copy(Space &home)
Perform cloning.
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
IntAction iaction
Integer action.
int start
Unassigned views start here (might be in x or y)
void dispose(void)
Dispose.
With highest CHB Q-score.
Select by maximal Action over size.
Choice storing position and value
Base class for value selection and commit.
Base-class for both propagators and branchers.
BoolAFC bafc
Boolean AFC information.
void expand(Home home, const IntVarArgs &x, const BoolVarArgs &y)
Expand AFC, action, and CHB.
Select
Which variable selection.
void dispose(void)
Dispose.
BoolCHB bchb
Boolean CHB information.
int p
Number of positive literals for node type.
BoolCHB bchb
Boolean CHB information.
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
With largest CHB Q-score divided by domain size.
BoolAction baction
Boolean Action information.
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
int n
Number of negative literals for node type.
Base-class for brancher for integer and Boolean views.
With largest accumulated failure count divided by domain size.
MeritMaxCHB(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
IntBoolVarBranch INTBOOL_VAR_AFC_MAX(double d=1.0)
Variable selection for both integer and Boolean variables.
double decay(void) const
Return decay factor.
Select greatest value not greater than the median.
ViewArray< Int::BoolView > y
Boolean views to branch on.
Which integer or Boolean variable to select for branching.
Select select(void) const
Return selection strategy.
ViewArray< Int::IntView > x
Integer views to branch on.
Recording AFC information for integer variables.
MeritMaxCHBSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Select select(void) const
Return selection strategy.
double operator()(Int::IntView x, int i) const
Return merit.
Recording AFC information for Boolean variables.
BoolValBranch i2b(const IntValBranch &ivb)
Map respective integer value selection to Boolean value selection.
Recording actions for Boolean variables.
IntAFC iafc
Integer AFC information.
IntCHB ichb
Integer CHB information.
Recording CHB for integer variables.
BoolAFC bafc
Boolean AFC information.
void dispose(void)
Dispose.
Passing integer variables.
IntBoolBrancher(Space &home, IntBoolBrancher &b)
Constructor for cloning b.
Select by maximal AFC over size.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
virtual const Choice * choice(Space &home)
Return choice.
Passing Boolean variables.
MeritMaxAction(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Brancher for integer and Boolean views.
Select values greater than mean of smallest and largest value.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
IntBoolBrancherBase(Space &home, IntBoolBrancherBase &b)
Constructor for cloning b.
Select by maximal CHB over size.
MeritMaxAFCSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
IntAction iaction
Integer Action information.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Integer view for integer variables.
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Post propagator for SetVar SetOpType SetVar y
double operator()(Int::IntView x, int i) const
Return merit.
IntAction intaction(void) const
Return integer action.
Variable branching information.
Select values not greater than mean of smallest and largest value.
With largest action divided by domain size.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
Choice for performing commit
virtual size_t dispose(Space &home)
Delete actor and return its size.
int val(void) const
Return value to assign to.
Select by maximal Action.
IntBoolVarBranch INTBOOL_VAR_AFC_SIZE_MAX(double d=1.0)
Select variable with largest accumulated failure count divided by domain size.
IntBoolVarBranch INTBOOL_VAR_CHB_MAX(double d=1.0)
Select variable with largest CHB Q-score.
bool assigned(View x, int v)
Whether x is assigned to value v.
IntAFC intafc(void) const
Return integer AFC.
ValSelCommitBase< Int::BoolView, int > * yvsc
Boolean value selection and commit object.
IntAction iaction
Integer Action information.
BoolAction baction
Boolean Action information.
Post propagator for SetVar x
MeritMaxActionSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Recording CHB for Boolean variables.
void dispose(void)
Dispose.
MeritMaxAFC(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
double operator()(Int::IntView x, int i) const
Return merit.
IntBoolVarBranch INTBOOL_VAR_ACTION_MAX(double d=1.0)
Select variable with highest action.
Gecode toplevel namespace
double operator()(Int::IntView x, int i) const
Return merit.
BoolAction boolaction(void) const
Return Boolean action.
BoolAFC boolafc(void) const
Return Boolean AFC.
int size(void) const
Return size of array (number of elements)
Home class for posting propagators
Select value according to user-defined functions.
#define GECODE_NEVER
Assert that this command is never executed.
virtual Actor * copy(Space &home)=0
Create copy.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
IntBoolVarBranch INTBOOL_VAR_CHB_SIZE_MAX(double d=1.0)
Select variable with largest CHB Q-score divided by domain size.
int pos(void) const
Return position of view to assign.
Recording actions for integer variables.
double afc(void) const
Return accumulated failure count.
Select s
Which variable to select.
Boolean view for Boolean variables.