61 return (i == 0) || (i == 2);
82 :
Base(
"Int::Branch::FilteredRndTies") {}
85 virtual bool run(
void) {
86 bool selected[2] = {
false,
false};
88 for (
unsigned int seed = 1; seed <= 16; seed++) {
98 const int p = pc.
pos().
pos;
101 if ((p != 0) && (p != 2))
103 selected[p == 2] =
true;
128 return selected[0] && selected[1];
Choice for performing commit
Depth-first search engine.
Passing integer variables.
const Pos & pos(void) const
Return position in array.
const int pos
Position of view.
virtual T * next(void)
Return next solution (nullptr, if none exists or search has been stopped).
unsigned int c_d
Create a clone after every c_d commits (commit distance).
unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance).
bool assigned(void) const
Test if all variables are assigned.
Abstract class for view selection.
Base(std::string s)
Create and register test with name s.
Space for testing filtered random tie selection.
virtual Gecode::Space * copy(void)
Copy space during cloning.
FilteredRndTiesSpace(FilteredRndTiesSpace &s)
Constructor for cloning.
FilteredRndTiesSpace(Gecode::Rnd r)
Initialize space.
Gecode::IntVarArray x
Variables to branch on.
Test filtered random tie selection with accepted and rejected views.
virtual bool run(void)
Run test.
FilteredRndTies(void)
Create and register test.
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Test brancher with distinct propagator
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post propagators on variables x.
Int(const std::string &s, const Gecode::IntSet &d, int n)
Create and register test.
Space(void)
Default constructor.
const Choice * choice(void)
Create new choice for current brancher.
SpaceStatus status(StatusStatistics &stat)
Query space status.
@ SS_BRANCH
Space must be branched (at least one brancher left)
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
Gecode toplevel namespace
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl=IPL_DEF)
Post propagator for for all .
void postviewvalbrancher(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, BranchFilter< typename View::VarType > bf, VarValPrint< typename View::VarType, Val > vvp)
Post view value brancher.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest domain size.
Int d_5("Dense::5", d_dense, 5)
Gecode::IntSet d_sparse(v_sparse, 5)
Int s_3("Sparse::3", d_sparse, 3)
Gecode::IntSet d_large(-2, 10)
FilteredRndTies filtered_rnd_ties
Int s_5("Sparse::5", d_sparse, 5)
Int l_3("Large::3", d_large, 3)
Int d_3("Dense::3", d_dense, 3)
Gecode::IntSet d_dense(-2, 2)
Int l_2("Large::2", d_large, 2)