Go to the documentation of this file.
38 #ifndef __GECODE_INT_BRANCH_HH__
39 #define __GECODE_INT_BRANCH_HH__
48 namespace Gecode {
namespace Int {
namespace Branch {
249 namespace Gecode {
namespace Int {
namespace Branch {
253 ViewSel<IntView>*
viewsel(Space& home,
const IntVarBranch& ivb);
256 ViewSel<BoolView>*
viewsel(Space& home,
const BoolVarBranch& bvb);
260 namespace Gecode {
namespace Int {
namespace Branch {
407 namespace Gecode {
namespace Int {
namespace Branch {
485 namespace Gecode {
namespace Int {
namespace Branch {
519 std::ostream& o)
const;
542 std::ostream& o)
const;
565 std::ostream& o)
const;
588 std::ostream& o)
const;
595 namespace Gecode {
namespace Int {
namespace Branch {
599 ValSelCommitBase<IntView,int>*
604 ValSelCommitBase<BoolView,int>*
609 ValSelCommitBase<IntView,int>*
614 ValSelCommitBase<BoolView,int>*
619 namespace Gecode {
namespace Int {
namespace Branch {
625 template<
int n,
bool min,
class Filter,
class Pr
int>
656 std::ostream& o)
const;
669 template<
int n,
bool min>
679 #ifdef GECODE_HAS_CBS
681 namespace Gecode {
namespace Int {
namespace Branch {
688 class CBSBrancher :
public Brancher {
700 class VarIdToPos :
public SharedHandle {
702 class VarIdToPosO :
public SharedHandle::Object {
705 std::unordered_map<unsigned int, unsigned int> _varIdToPos;
708 VarIdToPosO(
void) =
default;
710 virtual ~VarIdToPosO(
void) =
default;
714 VarIdToPos(
void) =
default;
718 bool isIn(
unsigned int var_id)
const;
720 int operator[](
unsigned int var_id)
const;
722 void insert(
unsigned int var_id,
unsigned int pos);
756 std::unordered_map<
unsigned int, PropInfo,
757 std::hash<unsigned int>,
758 std::equal_to<unsigned int>,
759 space_allocator<std::pair<const unsigned int, PropInfo>>>
764 CBSBrancher(Home home, ViewArray<View>& x0);
766 CBSBrancher(Space& home, CBSBrancher&
b);
768 static void post(Home home, ViewArray<View>&
x);
770 virtual Actor* copy(Space& home);
772 virtual size_t dispose(Space& home);
774 virtual bool status(
const Space& home)
const;
776 virtual const Choice* choice(Space& home);
778 virtual const Choice* choice(
const Space&, Archive& e);
780 virtual ExecStatus commit(Space& home,
const Choice&
c,
unsigned int a);
782 virtual void print(
const Space& home,
const Choice&
c,
unsigned int a,
783 std::ostream& o)
const;
786 bool inbrancher(
unsigned int varId)
const;
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
ViewValuesBrancher(Space &home, ViewValuesBrancher &b)
Constructor for cloning b.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Class for action management.
Post propagator for SetVar x
MeritRegretMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
ValSelRnd(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
NqNGL(Space &home, View x, int n)
Constructor for creation.
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
MeritMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Value selection class for random value of view.
Merit class for CHB over size.
ValSelMed(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
virtual NGL * copy(Space &home)
Create copy.
MeritCHBSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Value commit class for greater.
Class for CHB management.
Base class for value selection.
ValCommitLq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Value selection class for maximum of view.
ValSelAvg(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
ViewArray< IntView > x
Views to branch on.
Base class for value commit.
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
double operator()(const Space &home, View x, int i)
Return action over size as merit for view x at position i.
Base-class for both propagators and branchers.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
EqNGL(Space &home, View x, int n)
Constructor for creation.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Value commit class for equality.
Brancher by view and values selection
int val(const Space &home, View x, int i)
Return value of view x at position i.
virtual NGL * copy(Space &home)
Create copy.
double operator()(const Space &home, View x, int i)
Return degree over size as merit for view x at position i.
int val(const Space &home, View x, int i)
Return value of view x at position i.
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Rnd r
The used random number generator.
MeritSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
No-good literal for less or equal.
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
double operator()(const Space &home, View x, int i)
Return AFC over size as merit for view x at position i.
Variable branching information.
Gecode toplevel namespace
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Value commit class for greater or equal.
No-good literal for greater or equal.
int operator()(const Space &home, View x, int i)
Return maximum as merit for view x at position i.
Generic brancher by view selection.
Value selection class for maximum range of integer view.
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
MeritActionSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
ViewSel< IntView > * vs[n]
View selection objects.
void dispose(Space &home)
Delete value selection.
double operator()(const Space &home, View x, int i)
Return size over action as merit for view x at position i.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Value selection class for median of view.
int operator()(const Space &home, View x, int i)
Return minimum as merit for view x at position i.
#define GECODE_INT_EXPORT
ValCommitGq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
ValCommitEq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Home class for posting propagators
Merit class for AFC over size.
Base-class for merit class.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Merit class for minimum regret.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Value branching information.
MeritRegretMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
unsigned int operator()(const Space &home, View x, int i)
Return size as merit for view x at position i.
No-good literal for equality.
View-value no-good literal.
LqNGL(Space &home, View x, int n)
Constructor for creation.
virtual NGL * copy(Space &home)
Create copy.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
void dispose(Space &home)
Dispose view selection.
GqNGL(Space &home, View x, int n)
Constructor for creation.
virtual const Choice * choice(Space &home)
Return choice.
ValSelMin(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Merit class for mimimum of integer views.
Action action
Action information.
int ModEvent
Type for modification events.
Value commit class for less or equal.
Value selection class for average of view.
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
void dispose(Space &home)
Dispose view selection.
ValSelMax(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Class for AFC (accumulated failure count) management.
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
Merit class for maximum regret.
static void post(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post function for creation.
unsigned int operator()(const Space &home, View x, int i)
Return maximum regret as merit for view x at position i.
Integer view for integer variables.
MeritMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
virtual void print(const Space &home, const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
int val(const Space &home, View x, int i)
Return value of view x at position i.
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
void postviewvaluesbrancher(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post brancher for view and values.
virtual Actor * copy(Space &home)
Perform cloning.
virtual NGL * copy(Space &home)
Create copy.
unsigned int operator()(const Space &home, View x, int i)
Return minimum regret as merit for view x at position i.
ValSelRangeMax(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.
Gecode::FloatVal c(-8, 8)
No-good literal recorded during search.
No-good literal for disequality.
virtual NGL * ngl(Space &home, const Choice &c, unsigned int a) const
Create no-good literal for choice c and alternative a.
int n
Number of negative literals for node type.
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
Status
The status of a no-good literal.
Choice for performing commit
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
void dispose(Space &home)
Dispose view selection.
Value selection class for minimum range of integer view.
int val(const Space &home, View x, int i)
Return value of view x at position i.
Gecode::IntArgs i({1, 2, 3, 4})
bool pos(const View &x)
Test whether x is postive.
int val(const Space &home, View x, int i)
Return value of view x at position i.
Value selection class for mimimum of view.
ValCommitGr(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Merit class for action over size.
MeritDegreeSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
void print(const Search::Statistics &stat, bool restart)
Print statistics.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int a)
Perform commit for choice c and alternative a.
std::function< void(const Space &home, const Brancher &b, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)> IntVarValPrint
Function type for printing branching alternatives for integer variables.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Merit class for degree over size.
MeritAFCSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
ValSelRangeMin(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.