38#ifndef __GECODE_INT_BRANCH_HH__
39#define __GECODE_INT_BRANCH_HH__
249namespace Gecode {
namespace Int {
namespace Branch {
253 ViewSel<IntView>*
viewsel(Space& home,
const IntVarBranch& ivb);
256 ViewSel<BoolView>*
viewsel(Space& home,
const BoolVarBranch& bvb);
407namespace Gecode {
namespace Int {
namespace Branch {
485namespace 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;
595namespace Gecode {
namespace Int {
namespace Branch {
599 ValSelCommitBase<IntView,int>*
604 ValSelCommitBase<BoolView,int>*
609 ValSelCommitBase<IntView,int>*
614 ValSelCommitBase<BoolView,int>*
625 template<
int n,
bool min,
class Filter,
class Pr
int>
656 std::ostream& o)
const;
669 template<
int n,
bool min>
681namespace 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;
Class for AFC (accumulated failure count) management.
Class for action management.
Class for CHB management.
Home class for posting propagators
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
virtual NGL * copy(Space &home)
Create copy.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
EqNGL(Space &home, View x, int n)
Constructor for creation.
virtual NGL * copy(Space &home)
Create copy.
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
GqNGL(Space &home, View x, int n)
Constructor for creation.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
virtual NGL * copy(Space &home)
Create copy.
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
LqNGL(Space &home, View x, int n)
Constructor for creation.
void dispose(Space &home)
Dispose view selection.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
double operator()(const Space &home, View x, int i)
Return AFC over size as merit for view x at position i.
MeritAFCSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Action action
Action information.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
MeritActionSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
double operator()(const Space &home, View x, int i)
Return action over size as merit for view x at position i.
void dispose(Space &home)
Dispose view selection.
void dispose(Space &home)
Dispose view selection.
double operator()(const Space &home, View x, int i)
Return size over action as merit for view x at position i.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
MeritCHBSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
double operator()(const Space &home, View x, int i)
Return degree over size as merit for view x at position i.
MeritDegreeSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
MeritMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
int operator()(const Space &home, View x, int i)
Return maximum as merit for view x at position i.
MeritMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
int operator()(const Space &home, View x, int i)
Return minimum as merit for view x at position i.
MeritRegretMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
unsigned int operator()(const Space &home, View x, int i)
Return maximum regret as merit for view x at position i.
MeritRegretMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
unsigned int operator()(const Space &home, View x, int i)
Return minimum regret as merit for view x at position i.
MeritSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
unsigned int operator()(const Space &home, View x, int i)
Return size as merit for view x at position i.
NqNGL(Space &home, View x, int n)
Constructor for creation.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
virtual NGL * copy(Space &home)
Create copy.
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
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 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.
ValCommitEq(Space &home, const ValBranch< 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.
ValCommitGq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
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.
ValCommitGr(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.
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.
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.
ValCommitLq(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.
ValSelAvg(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
int val(const Space &home, View x, int i)
Return value of view x at position i.
int val(const Space &home, View x, int i)
Return value of view x at position i.
ValSelMax(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
ValSelMed(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
int val(const Space &home, View x, int i)
Return value of view x at position i.
ValSelMin(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
int val(const Space &home, View x, int i)
Return value of view x at position i.
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
ValSelRangeMax(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
ValSelRangeMin(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.
int val(const Space &home, View x, int i)
Return value of view x at position i.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Rnd r
The used random number generator.
ValSelRnd(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
void dispose(Space &home)
Delete value selection.
virtual void print(const Space &home, const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
ViewValuesBrancher(Space &home, ViewValuesBrancher &b)
Constructor for cloning b.
virtual Actor * copy(Space &home)
Perform cloning.
static void post(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post function for creation.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int a)
Perform commit for choice c and alternative a.
virtual const Choice * choice(Space &home)
Return choice.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
virtual NGL * ngl(Space &home, const Choice &c, unsigned int a) const
Create no-good literal for choice c and alternative a.
Integer view for integer variables.
View::VarType Var
Corresponding variable type.
MeritBase(Space &home, const VarBranch< Var > &vb)
No-good literal recorded during search.
NGL(void)
Constructor for creation.
Status
The status of a no-good literal.
Value branching information.
ValCommit(Space &home, const ValBranch< Var > &vb)
View::VarType Var
Corresponding variable type.
ValSel(Space &home, const ValBranch< Var > &vb)
View::VarType Var
Corresponding variable type.
Variable branching information.
ViewBrancher(Space &home, ViewBrancher< IntView, Filter, n > &b)
ViewSel< IntView > * vs[n]
Abstract class for view selection.
ViewValNGL(Space &home, View x, int n)
#define GECODE_INT_EXPORT
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
void print(const Search::Statistics &stat, bool restart)
Print statistics.
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
void postviewvaluesbrancher(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post brancher for view and values.
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Gecode toplevel namespace
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
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.
Post propagator for SetVar x
int ModEvent
Type for modification events.