branch.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2017
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
namespace Gecode { namespace FlatZinc {
forceinline
IntBoolVarBranch::IntBoolVarBranch(Select s0, double d)
: VarBranch<IntVar>(d), s(s0) {}
forceinline
IntBoolVarBranch::IntBoolVarBranch(Select s0, IntAFC i, BoolAFC b)
: s(s0), iafc(i), bafc(b) {}
forceinline
IntBoolVarBranch::IntBoolVarBranch(Select s0, IntAction i, BoolAction b)
: s(s0), iaction(i), baction(b) {}
forceinline
IntBoolVarBranch::IntBoolVarBranch(Select s0, IntCHB i, BoolCHB b)
: s(s0), ichb(i), bchb(b) {}
forceinline IntBoolVarBranch::Select
IntBoolVarBranch::select(void) const {
return s;
}
forceinline IntAFC
IntBoolVarBranch::intafc(void) const {
return iafc;
}
forceinline BoolAFC
IntBoolVarBranch::boolafc(void) const {
return bafc;
}
forceinline IntAction
IntBoolVarBranch::intaction(void) const {
return iaction;
}
forceinline BoolAction
IntBoolVarBranch::boolaction(void) const {
return baction;
}
forceinline IntCHB
IntBoolVarBranch::intchb(void) const {
return ichb;
}
forceinline BoolCHB
IntBoolVarBranch::boolchb(void) const {
return bchb;
}
forceinline void
IntBoolVarBranch::expand(Home home, const IntVarArgs& x, const BoolVarArgs& y) {
switch (select()) {
case IntBoolVarBranch::SEL_AFC_MAX:
case IntBoolVarBranch::SEL_AFC_SIZE_MAX:
if (!iafc)
iafc = IntAFC(home,x,decay());
if (!bafc)
bafc = BoolAFC(home,y,decay());
break;
case IntBoolVarBranch::SEL_ACTION_MAX:
case IntBoolVarBranch::SEL_ACTION_SIZE_MAX:
if (!iaction)
iaction = IntAction(home,x,decay());
if (!baction)
baction = BoolAction(home,y,decay());
break;
case IntBoolVarBranch::SEL_CHB_MAX:
case IntBoolVarBranch::SEL_CHB_SIZE_MAX:
if (!ichb)
ichb = IntCHB(home,x);
if (!bchb)
bchb = BoolCHB(home,y);
break;
default: ;
}
}
inline IntBoolVarBranch
INTBOOL_VAR_AFC_MAX(double d) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_AFC_MAX,d);
}
inline IntBoolVarBranch
INTBOOL_VAR_AFC_MAX(IntAFC ia, BoolAFC ba) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_AFC_MAX,ia,ba);
}
inline IntBoolVarBranch
INTBOOL_VAR_ACTION_MAX(double d) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_ACTION_MAX,d);
}
inline IntBoolVarBranch
INTBOOL_VAR_ACTION_MAX(IntAction ia, BoolAction ba) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_ACTION_MAX,ia,ba);
}
inline IntBoolVarBranch
INTBOOL_VAR_CHB_MAX(double d) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_CHB_MAX,d);
}
inline IntBoolVarBranch
INTBOOL_VAR_CHB_MAX(IntCHB ic, BoolCHB bc) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_CHB_MAX,ic,bc);
}
inline IntBoolVarBranch
INTBOOL_VAR_AFC_SIZE_MAX(double d) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_AFC_SIZE_MAX,d);
}
inline IntBoolVarBranch
INTBOOL_VAR_AFC_SIZE_MAX(IntAFC ia, BoolAFC ba) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_AFC_SIZE_MAX,ia,ba);
}
inline IntBoolVarBranch
INTBOOL_VAR_ACTION_SIZE_MAX(double d) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_ACTION_SIZE_MAX,d);
}
inline IntBoolVarBranch
INTBOOL_VAR_ACTION_SIZE_MAX(IntAction ia, BoolAction ba) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_ACTION_SIZE_MAX,ia,ba);
}
inline IntBoolVarBranch
INTBOOL_VAR_CHB_SIZE_MAX(double d) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_CHB_SIZE_MAX,d);
}
inline IntBoolVarBranch
INTBOOL_VAR_CHB_SIZE_MAX(IntCHB ic, BoolCHB bc) {
return IntBoolVarBranch(IntBoolVarBranch::SEL_CHB_SIZE_MAX,ic,bc);
}
forceinline
MeritMaxAFC::MeritMaxAFC(Space&, const IntBoolVarBranch& ibvb)
: iafc(ibvb.intafc()), bafc(ibvb.boolafc()) {}
forceinline
MeritMaxAFC::MeritMaxAFC(Space&, MeritMaxAFC& m)
: iafc(m.iafc), bafc(m.bafc) {}
forceinline double
MeritMaxAFC::operator ()(Int::IntView x, int) const {
return x.afc();
}
forceinline double
MeritMaxAFC::operator ()(Int::BoolView x, int) const {
return x.afc();
}
forceinline void
MeritMaxAFC::dispose(void) {
iafc.~IntAFC();
bafc.~BoolAFC();
}
forceinline
MeritMaxAFCSize::MeritMaxAFCSize(Space&, const IntBoolVarBranch& ibvb)
: iafc(ibvb.intafc()), bafc(ibvb.boolafc()) {}
forceinline
MeritMaxAFCSize::MeritMaxAFCSize(Space&, MeritMaxAFCSize& m)
: iafc(m.iafc), bafc(m.bafc) {}
forceinline double
MeritMaxAFCSize::operator ()(Int::IntView x, int) const {
return x.afc() / x.size();
}
forceinline double
MeritMaxAFCSize::operator ()(Int::BoolView x, int) const {
return x.afc() / 2.0;
}
forceinline void
MeritMaxAFCSize::dispose(void) {
iafc.~IntAFC();
bafc.~BoolAFC();
}
forceinline
MeritMaxAction::MeritMaxAction(Space&, const IntBoolVarBranch& ibvb)
: iaction(ibvb.intaction()), baction(ibvb.boolaction()) {}
forceinline
MeritMaxAction::MeritMaxAction(Space&, MeritMaxAction& m)
: iaction(m.iaction), baction(m.baction) {}
forceinline double
MeritMaxAction::operator ()(Int::IntView, int i) const {
return iaction[i];
}
forceinline double
MeritMaxAction::operator ()(Int::BoolView, int i) const {
return baction[i];
}
forceinline void
MeritMaxAction::dispose(void) {
iaction.~IntAction();
baction.~BoolAction();
}
forceinline
MeritMaxActionSize::MeritMaxActionSize(Space&, const IntBoolVarBranch& ibvb)
: iaction(ibvb.intaction()), baction(ibvb.boolaction()) {}
forceinline
MeritMaxActionSize::MeritMaxActionSize(Space&, MeritMaxActionSize& m)
: iaction(m.iaction), baction(m.baction) {}
forceinline double
MeritMaxActionSize::operator ()(Int::IntView x, int i) const {
return iaction[i] / x.size();
}
forceinline double
MeritMaxActionSize::operator ()(Int::BoolView, int i) const {
return baction[i] / 2.0;
}
forceinline void
MeritMaxActionSize::dispose(void) {
iaction.~IntAction();
baction.~BoolAction();
}
forceinline
MeritMaxCHB::MeritMaxCHB(Space&, const IntBoolVarBranch& ibvb)
: ichb(ibvb.intchb()), bchb(ibvb.boolchb()) {}
forceinline
MeritMaxCHB::MeritMaxCHB(Space&, MeritMaxCHB& m)
: ichb(m.ichb), bchb(m.bchb) {}
forceinline double
MeritMaxCHB::operator ()(Int::IntView, int i) const {
return ichb[i];
}
forceinline double
MeritMaxCHB::operator ()(Int::BoolView, int i) const {
return bchb[i];
}
forceinline void
MeritMaxCHB::dispose(void) {
ichb.~IntCHB();
bchb.~BoolCHB();
}
forceinline
MeritMaxCHBSize::MeritMaxCHBSize(Space&, const IntBoolVarBranch& ibvb)
: ichb(ibvb.intchb()), bchb(ibvb.boolchb()) {}
forceinline
MeritMaxCHBSize::MeritMaxCHBSize(Space&, MeritMaxCHBSize& m)
: ichb(m.ichb), bchb(m.bchb) {}
forceinline double
MeritMaxCHBSize::operator ()(Int::IntView x, int i) const {
return ichb[i] / x.size();
}
forceinline double
MeritMaxCHBSize::operator ()(Int::BoolView, int i) const {
return bchb[i] / 2.0;
}
forceinline void
MeritMaxCHBSize::dispose(void) {
ichb.~IntCHB();
bchb.~BoolCHB();
}
forceinline
PosIntChoice::PosIntChoice(const Brancher& b, unsigned int a, int p, int n)
: Choice(b,a), _pos(p), _val(n) {}
forceinline int
PosIntChoice::pos(void) const {
return _pos;
}
forceinline int
PosIntChoice::val(void) const {
return _val;
}
forceinline
IntBoolBrancherBase::
IntBoolBrancherBase(Home home,
ViewArray<Int::IntView> x0,
ViewArray<Int::BoolView> y0,
ValSelCommitBase<Int::IntView,int>* xvsc0,
ValSelCommitBase<Int::BoolView,int>* yvsc0)
: Brancher(home), x(x0), y(y0), start(0), xvsc(xvsc0), yvsc(yvsc0) {
home.notice(*this,AP_DISPOSE,true);
}
forceinline
IntBoolBrancherBase::
IntBoolBrancherBase(Space& home, IntBoolBrancherBase& b)
: Brancher(home,b), start(b.start),
xvsc(b.xvsc->copy(home)), yvsc(b.yvsc->copy(home)) {
x.update(home,b.x);
y.update(home,b.y);
}
forceinline size_t
IntBoolBrancherBase::dispose(Space& home) {
home.ignore(*this,AP_DISPOSE,true);
xvsc->dispose(home);
yvsc->dispose(home);
(void) Brancher::dispose(home);
return sizeof(IntBoolBrancherBase);
}
template<class Merit>
forceinline
IntBoolBrancher<Merit>::
IntBoolBrancher(Home home,
ViewArray<Int::IntView> x,
ViewArray<Int::BoolView> y,
Merit& m,
ValSelCommitBase<Int::IntView,int>* xvsc,
ValSelCommitBase<Int::BoolView,int>* yvsc)
: IntBoolBrancherBase(home,x,y,xvsc,yvsc), merit(m) {}
template<class Merit>
forceinline void
IntBoolBrancher<Merit>::
post(Home home,
ViewArray<Int::IntView> x,
ViewArray<Int::BoolView> y,
Merit& m,
ValSelCommitBase<Int::IntView,int>* xvsc,
ValSelCommitBase<Int::BoolView,int>* yvsc) {
(void) new (home) IntBoolBrancher<Merit>(home, x, y, m, xvsc, yvsc);
}
template<class Merit>
forceinline
IntBoolBrancher<Merit>::
IntBoolBrancher(Space& home, IntBoolBrancher<Merit>& b)
: IntBoolBrancherBase(home,b), merit(home, b.merit) {
}
template<class Merit>
Actor*
IntBoolBrancher<Merit>::copy(Space& home) {
return new (home) IntBoolBrancher<Merit>(home,*this);
}
template<class Merit>
const Choice*
IntBoolBrancher<Merit>::choice(Space& home) {
int p = start;
double m;
if (p < x.size()) {
assert(!x[p].assigned());
m=merit(x[p],p);
for (int i=p+1; i<x.size(); i++)
if (!x[i].assigned()) {
double mi = merit(x[i],i);
if (mi > m) {
m=mi; p=i;
}
}
for (int i=0; i<y.size(); i++)
if (!y[i].assigned()) {
double mi = merit(y[i],i);
if (mi > m) {
m=mi; p=i+x.size();
}
}
} else {
assert(!y[p-x.size()].assigned());
m=merit(y[p-x.size()],p-x.size());
for (int i=p-x.size()+1; i<y.size(); i++)
if (!y[i].assigned()) {
double mi = merit(y[i],i);
if (mi > m) {
m=mi; p=i+x.size();
}
}
}
int v;
if (p < x.size()) {
v=xvsc->val(home,x[p],p);
} else {
v=yvsc->val(home,y[p-x.size()],p-x.size());
}
return new PosIntChoice(*this,2,p,v);
}
template<class Merit>
size_t
IntBoolBrancher<Merit>::dispose(Space& home) {
merit.dispose();
(void) IntBoolBrancherBase::dispose(home);
return sizeof(IntBoolBrancher<Merit>);
}
forceinline BoolValBranch
i2b(const IntValBranch& ivb) {
switch (ivb.select()) {
case IntValBranch::SEL_MIN:
case IntValBranch::SEL_MED:
case IntValBranch::SEL_SPLIT_MIN:
case IntValBranch::SEL_RANGE_MIN:
return BOOL_VAL_MIN();
case IntValBranch::SEL_MAX:
case IntValBranch::SEL_SPLIT_MAX:
case IntValBranch::SEL_RANGE_MAX:
return BOOL_VAL_MAX();
case IntValBranch::SEL_RND:
return BOOL_VAL_RND(ivb.rnd());
case IntValBranch::SEL_VAL_COMMIT:
default:
GECODE_NEVER;
}
GECODE_NEVER;
return BOOL_VAL_MIN();
}
}}
// STATISTICS: flatzinc-branch
Gecode::Actor
Base-class for both propagators and branchers.
Definition core.hpp:628
Gecode::Actor::copy
virtual Actor * copy(Space &home)=0
Create copy.
Gecode::Actor::dispose
virtual size_t dispose(Space &home)
Delete actor and return its size.
Definition core.hpp:3252
Gecode::BoolAFC
Recording AFC information for Boolean variables.
Definition int.hh:4316
Gecode::BoolAction
Recording actions for Boolean variables.
Definition int.hh:4407
Gecode::BoolCHB
Recording CHB for Boolean variables.
Definition int.hh:4502
Gecode::BoolValBranch
Which values to select for branching first.
Definition int.hh:4889
Gecode::BoolVarArgs
Passing Boolean variables.
Definition int.hh:712
Gecode::Merit
Gecode::Brancher
Base-class for branchers.
Definition core.hpp:1442
Gecode::Brancher::Space
friend class Space
Definition core.hpp:1444
Gecode::Brancher::Brancher
Brancher(Home home)
Constructor for creation.
Definition core.hpp:3605
Gecode::Choice
Choice for performing commit
Definition core.hpp:1412
Gecode::Choice::Choice
Choice(const Brancher &b, const unsigned int a)
Initialize for particular brancher b and alternatives a.
Definition core.hpp:3766
Gecode::FlatZinc::IntBoolBrancherBase
Base-class for brancher for integer and Boolean views.
Definition branch.hh:264
Gecode::FlatZinc::IntBoolBrancherBase::y
ViewArray< Int::BoolView > y
Boolean views to branch on.
Definition branch.hh:269
Gecode::FlatZinc::IntBoolBrancherBase::x
ViewArray< Int::IntView > x
Integer views to branch on.
Definition branch.hh:267
Gecode::FlatZinc::IntBoolBrancherBase::IntBoolBrancherBase
IntBoolBrancherBase(Space &home, IntBoolBrancherBase &b)
Constructor for cloning b.
Definition branch.hpp:316
Gecode::FlatZinc::IntBoolBrancherBase::yvsc
ValSelCommitBase< Int::BoolView, int > * yvsc
Boolean value selection and commit object.
Definition branch.hh:275
Gecode::FlatZinc::IntBoolBrancherBase::xvsc
ValSelCommitBase< Int::IntView, int > * xvsc
Integer value selection and commit object.
Definition branch.hh:273
Gecode::FlatZinc::IntBoolBrancherBase::dispose
virtual size_t dispose(Space &home)
Delete brancher and return its size.
Definition branch.hpp:324
Gecode::FlatZinc::IntBoolBrancherBase::start
int start
Unassigned views start here (might be in x or y).
Definition branch.hh:271
Gecode::FlatZinc::IntBoolBrancher
Brancher for integer and Boolean views.
Definition branch.hh:303
Gecode::FlatZinc::IntBoolBrancher::choice
virtual const Choice * choice(Space &home)
Return choice.
Definition branch.hpp:371
Gecode::FlatZinc::IntBoolBrancher::copy
virtual Actor * copy(Space &home)
Perform cloning.
Definition branch.hpp:365
Gecode::FlatZinc::IntBoolBrancher::dispose
virtual size_t dispose(Space &home)
Delete brancher and return its size.
Definition branch.hpp:413
Gecode::FlatZinc::IntBoolBrancher::merit
Merit merit
Selection by maximal merit.
Definition branch.hh:306
Gecode::FlatZinc::IntBoolBrancher::IntBoolBrancher
IntBoolBrancher(Space &home, IntBoolBrancher &b)
Constructor for cloning b.
Gecode::FlatZinc::IntBoolBrancher::post
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.
Definition branch.hpp:347
Gecode::FlatZinc::IntBoolVarBranch
Which integer or Boolean variable to select for branching.
Definition branch.hh:44
Gecode::FlatZinc::IntBoolVarBranch::boolchb
BoolCHB boolchb(void) const
Return Boolean AFC.
Definition branch.hpp:80
Gecode::FlatZinc::IntBoolVarBranch::iafc
IntAFC iafc
Integer AFC.
Definition branch.hh:59
Gecode::FlatZinc::IntBoolVarBranch::intchb
IntCHB intchb(void) const
Return integer CHB.
Definition branch.hpp:76
Gecode::FlatZinc::IntBoolVarBranch::bchb
BoolCHB bchb
Boolean CHB.
Definition branch.hh:69
Gecode::FlatZinc::IntBoolVarBranch::expand
void expand(Home home, const IntVarArgs &x, const BoolVarArgs &y)
Expand AFC, action, and CHB.
Definition branch.hpp:84
Gecode::FlatZinc::IntBoolVarBranch::s
Select s
Which variable to select.
Definition branch.hh:57
Gecode::FlatZinc::IntBoolVarBranch::IntBoolVarBranch
IntBoolVarBranch(Select s, double d)
Initialize with selection strategy s and decay factor d.
Definition branch.hpp:37
Gecode::FlatZinc::IntBoolVarBranch::bafc
BoolAFC bafc
Boolean AFC.
Definition branch.hh:61
Gecode::FlatZinc::IntBoolVarBranch::intaction
IntAction intaction(void) const
Return integer action.
Definition branch.hpp:67
Gecode::FlatZinc::IntBoolVarBranch::intafc
IntAFC intafc(void) const
Return integer AFC.
Definition branch.hpp:58
Gecode::FlatZinc::IntBoolVarBranch::boolafc
BoolAFC boolafc(void) const
Return Boolean AFC.
Definition branch.hpp:62
Gecode::FlatZinc::IntBoolVarBranch::boolaction
BoolAction boolaction(void) const
Return Boolean action.
Definition branch.hpp:71
Gecode::FlatZinc::IntBoolVarBranch::select
Select select(void) const
Return selection strategy.
Definition branch.hpp:53
Gecode::FlatZinc::IntBoolVarBranch::ichb
IntCHB ichb
Integer CHB.
Definition branch.hh:67
Gecode::FlatZinc::IntBoolVarBranch::baction
BoolAction baction
Boolean action.
Definition branch.hh:65
Gecode::FlatZinc::IntBoolVarBranch::iaction
IntAction iaction
Integer action.
Definition branch.hh:63
Gecode::FlatZinc::IntBoolVarBranch::Select
Select
Which variable selection.
Definition branch.hh:47
Gecode::FlatZinc::IntBoolVarBranch::SEL_ACTION_SIZE_MAX
@ SEL_ACTION_SIZE_MAX
With largest action divided by domain size.
Definition branch.hh:52
Gecode::FlatZinc::IntBoolVarBranch::SEL_CHB_SIZE_MAX
@ SEL_CHB_SIZE_MAX
With largest CHB Q-score divided by domain size.
Definition branch.hh:53
Gecode::FlatZinc::IntBoolVarBranch::SEL_ACTION_MAX
@ SEL_ACTION_MAX
With highest action.
Definition branch.hh:49
Gecode::FlatZinc::IntBoolVarBranch::SEL_AFC_MAX
@ SEL_AFC_MAX
With largest accumulated failure count.
Definition branch.hh:48
Gecode::FlatZinc::IntBoolVarBranch::SEL_CHB_MAX
@ SEL_CHB_MAX
With highest CHB Q-score.
Definition branch.hh:50
Gecode::FlatZinc::IntBoolVarBranch::SEL_AFC_SIZE_MAX
@ SEL_AFC_SIZE_MAX
With largest accumulated failure count divided by domain size.
Definition branch.hh:51
Gecode::FlatZinc::MeritMaxAFCSize::iafc
IntAFC iafc
Integer AFC information.
Definition branch.hh:149
Gecode::FlatZinc::MeritMaxAFCSize::operator()
double operator()(Int::IntView x, int i) const
Return merit.
Definition branch.hpp:192
Gecode::FlatZinc::MeritMaxAFCSize::bafc
BoolAFC bafc
Boolean AFC information.
Definition branch.hh:151
Gecode::FlatZinc::MeritMaxAFCSize::MeritMaxAFCSize
MeritMaxAFCSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Definition branch.hpp:186
Gecode::FlatZinc::MeritMaxAFCSize::dispose
void dispose(void)
Dispose.
Definition branch.hpp:200
Gecode::FlatZinc::MeritMaxAFC::MeritMaxAFC
MeritMaxAFC(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Definition branch.hpp:165
Gecode::FlatZinc::MeritMaxAFC::dispose
void dispose(void)
Dispose.
Definition branch.hpp:179
Gecode::FlatZinc::MeritMaxAFC::operator()
double operator()(Int::IntView x, int i) const
Return merit.
Definition branch.hpp:171
Gecode::FlatZinc::MeritMaxAFC::bafc
BoolAFC bafc
Boolean AFC information.
Definition branch.hh:131
Gecode::FlatZinc::MeritMaxAFC::iafc
IntAFC iafc
Integer AFC information.
Definition branch.hh:129
Gecode::FlatZinc::MeritMaxActionSize::dispose
void dispose(void)
Dispose.
Definition branch.hpp:242
Gecode::FlatZinc::MeritMaxActionSize::operator()
double operator()(Int::IntView x, int i) const
Return merit.
Definition branch.hpp:234
Gecode::FlatZinc::MeritMaxActionSize::baction
BoolAction baction
Boolean Action information.
Definition branch.hh:191
Gecode::FlatZinc::MeritMaxActionSize::MeritMaxActionSize
MeritMaxActionSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Definition branch.hpp:228
Gecode::FlatZinc::MeritMaxActionSize::iaction
IntAction iaction
Integer Action information.
Definition branch.hh:189
Gecode::FlatZinc::MeritMaxAction::dispose
void dispose(void)
Dispose.
Definition branch.hpp:221
Gecode::FlatZinc::MeritMaxAction::operator()
double operator()(Int::IntView x, int i) const
Return merit.
Definition branch.hpp:213
Gecode::FlatZinc::MeritMaxAction::baction
BoolAction baction
Boolean Action information.
Definition branch.hh:171
Gecode::FlatZinc::MeritMaxAction::MeritMaxAction
MeritMaxAction(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Definition branch.hpp:207
Gecode::FlatZinc::MeritMaxAction::iaction
IntAction iaction
Integer Action information.
Definition branch.hh:169
Gecode::FlatZinc::MeritMaxCHBSize::bchb
BoolCHB bchb
Boolean CHB information.
Definition branch.hh:231
Gecode::FlatZinc::MeritMaxCHBSize::dispose
void dispose(void)
Dispose.
Definition branch.hpp:284
Gecode::FlatZinc::MeritMaxCHBSize::ichb
IntCHB ichb
Integer CHB information.
Definition branch.hh:229
Gecode::FlatZinc::MeritMaxCHBSize::MeritMaxCHBSize
MeritMaxCHBSize(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Definition branch.hpp:270
Gecode::FlatZinc::MeritMaxCHBSize::operator()
double operator()(Int::IntView x, int i) const
Return merit.
Definition branch.hpp:276
Gecode::FlatZinc::MeritMaxCHB::operator()
double operator()(Int::IntView x, int i) const
Return merit.
Definition branch.hpp:255
Gecode::FlatZinc::MeritMaxCHB::dispose
void dispose(void)
Dispose.
Definition branch.hpp:263
Gecode::FlatZinc::MeritMaxCHB::MeritMaxCHB
MeritMaxCHB(Space &home, const IntBoolVarBranch &ibvb)
Constructor for initialization.
Definition branch.hpp:249
Gecode::FlatZinc::MeritMaxCHB::bchb
BoolCHB bchb
Boolean CHB information.
Definition branch.hh:211
Gecode::FlatZinc::MeritMaxCHB::ichb
IntCHB ichb
Integer CHB information.
Definition branch.hh:209
Gecode::FlatZinc::PosIntChoice
Choice storing position and value
Definition branch.hh:246
Gecode::FlatZinc::PosIntChoice::pos
int pos(void) const
Return position of view to assign.
Definition branch.hpp:294
Gecode::FlatZinc::PosIntChoice::val
int val(void) const
Return value to assign to.
Definition branch.hpp:298
Gecode::FlatZinc::PosIntChoice::PosIntChoice
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.
Definition branch.hpp:291
Gecode::FloatVal::x
FloatValImpType x
Implementation of float value.
Definition float.hh:425
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Home::notice
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Definition core.hpp:3219
Gecode::IntAFC
Recording AFC information for integer variables.
Definition int.hh:4276
Gecode::IntAction
Recording actions for integer variables.
Definition int.hh:4362
Gecode::IntCHB
Recording CHB for integer variables.
Definition int.hh:4458
Gecode::IntValBranch
Which values to select for branching first.
Definition int.hh:4854
Gecode::IntValBranch::SEL_RND
@ SEL_RND
Select random value.
Definition int.hh:4861
Gecode::IntValBranch::SEL_SPLIT_MAX
@ SEL_SPLIT_MAX
Select values greater than mean of smallest and largest value.
Definition int.hh:4863
Gecode::IntValBranch::SEL_MIN
@ SEL_MIN
Select smallest value.
Definition int.hh:4858
Gecode::IntValBranch::SEL_MAX
@ SEL_MAX
Select largest value.
Definition int.hh:4860
Gecode::IntValBranch::SEL_RANGE_MAX
@ SEL_RANGE_MAX
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition int.hh:4865
Gecode::IntValBranch::SEL_RANGE_MIN
@ SEL_RANGE_MIN
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition int.hh:4864
Gecode::IntValBranch::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:4866
Gecode::IntValBranch::SEL_MED
@ SEL_MED
Select greatest value not greater than the median.
Definition int.hh:4859
Gecode::IntValBranch::SEL_SPLIT_MIN
@ SEL_SPLIT_MIN
Select values not greater than mean of smallest and largest value.
Definition int.hh:4862
Gecode::IntValBranch::select
Select select(void) const
Return selection strategy.
Definition val.hpp:49
Gecode::IntVarArgs
Passing integer variables.
Definition int.hh:656
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::Int::BoolView
Boolean view for Boolean variables.
Definition view.hpp:1380
Gecode::Int::IntView
Integer view for integer variables.
Definition view.hpp:129
Gecode::Int::IntView::size
unsigned int size(void) const
Return size (cardinality) of domain.
Definition int.hpp:81
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::ValBranch::rnd
Rnd rnd(void) const
Return random number generator.
Definition val.hpp:90
Gecode::ValSelCommitBase
Base class for value selection and commit.
Definition val-sel-commit.hpp:44
Gecode::VarBranch< IntVar >::VarBranch
VarBranch(void)
Definition var.hpp:116
Gecode::VarBranch< IntVar >::decay
double decay(void) const
Definition var.hpp:180
Gecode::VarImpView::afc
double afc(void) const
Return accumulated failure count.
Definition view.hpp:504
Gecode::ViewArray
View arrays.
Definition array.hpp:253
Gecode::Space::ignore
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Definition core.hpp:4074
Gecode::AP_DISPOSE
@ AP_DISPOSE
Actor must always be disposed.
Definition core.hpp:562
Gecode::FlatZinc
Interpreter for the FlatZinc language.
Gecode::FlatZinc::INTBOOL_VAR_CHB_SIZE_MAX
IntBoolVarBranch INTBOOL_VAR_CHB_SIZE_MAX(double d=1.0)
Select variable with largest CHB Q-score divided by domain size.
Definition branch.hpp:154
Gecode::FlatZinc::INTBOOL_VAR_CHB_MAX
IntBoolVarBranch INTBOOL_VAR_CHB_MAX(double d=1.0)
Select variable with largest CHB Q-score.
Definition branch.hpp:130
Gecode::FlatZinc::INTBOOL_VAR_ACTION_MAX
IntBoolVarBranch INTBOOL_VAR_ACTION_MAX(double d=1.0)
Select variable with highest action.
Definition branch.hpp:122
Gecode::FlatZinc::i2b
BoolValBranch i2b(const IntValBranch &ivb)
Map respective integer value selection to Boolean value selection.
Definition branch.hpp:421
Gecode::FlatZinc::INTBOOL_VAR_AFC_SIZE_MAX
IntBoolVarBranch INTBOOL_VAR_AFC_SIZE_MAX(double d=1.0)
Select variable with largest accumulated failure count divided by domain size.
Definition branch.hpp:138
Gecode::FlatZinc::INTBOOL_VAR_ACTION_SIZE_MAX
IntBoolVarBranch INTBOOL_VAR_ACTION_SIZE_MAX(double d=1.0)
Select variable with largest action divided by domain size.
Definition branch.hpp:146
Gecode::FlatZinc::INTBOOL_VAR_AFC_MAX
IntBoolVarBranch INTBOOL_VAR_AFC_MAX(double d=1.0)
Variable selection for both integer and Boolean variables.
Definition branch.hpp:114
Gecode
Gecode toplevel namespace
Gecode::ba
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition ipl.hpp:43
Gecode::BOOL_VAL_MIN
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition val.hpp:130
Gecode::BOOL_VAL_MAX
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition val.hpp:135
Gecode::BOOL_VAL_RND
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition val.hpp:140
forceinline
#define forceinline
Definition config.hpp:187
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56