branch.cpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Mikael Lagerkvist <lagerkvist@gecode.org>
* Christian Schulte <schulte@gecode.org>
*
* Contributing authors:
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
*
* Copyright:
* Mikael Lagerkvist, 2005
* Christian Schulte, 2009
* Vincent Barichard, 2012
*
* 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.
*
*/
#include "test/branch.hh"
#include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <gecode/kernel.hh>
#include <gecode/int.hh>
#ifdef GECODE_HAS_SET_VARS
#include <gecode/set.hh>
#endif
#ifdef GECODE_HAS_FLOAT_VARS
#include <gecode/float.hh>
#endif
#include <gecode/search.hh>
namespace Test { namespace Branch {
double tbl(const Gecode::Space&, double w, double b) {
return (w + (b-w)/2.0);
}
class IntTestSpace : public Gecode::Space {
public:
Gecode::IntVarArray x;
Gecode::IntVarBranch vara, varb;
Gecode::IntValBranch val;
IntTestSpace(int n, Gecode::IntSet& d)
: x(*this, n, d),
vara(Gecode::INT_VAR_NONE()), varb(Gecode::INT_VAR_NONE()),
val(Gecode::INT_VAL_MIN()) {}
IntTestSpace(IntTestSpace& s)
: Gecode::Space(s), vara(s.vara), varb(s.varb), val(s.val) {
x.update(*this, s.x);
}
virtual Gecode::Space* copy(void) {
return new IntTestSpace(*this);
}
};
class BoolTestSpace : public Gecode::Space {
public:
Gecode::BoolVarArray x;
BoolTestSpace(int n)
: x(*this, n, 0, 1) {}
BoolTestSpace(BoolTestSpace& s)
: Gecode::Space(s) {
x.update(*this, s.x);
}
virtual Gecode::Space* copy(void) {
return new BoolTestSpace(*this);
}
};
#ifdef GECODE_HAS_SET_VARS
class SetTestSpace : public Gecode::Space {
public:
Gecode::SetVarArray x;
SetTestSpace(int n, Gecode::IntSet& d)
: x(*this, n, Gecode::IntSet::empty, d) {}
SetTestSpace(SetTestSpace& s)
: Gecode::Space(s) {
x.update(*this, s.x);
}
virtual Gecode::Space* copy(void) {
return new SetTestSpace(*this);
}
};
#endif
#ifdef GECODE_HAS_FLOAT_VARS
class FloatTestSpace : public Gecode::Space {
public:
Gecode::FloatVarArray x;
FloatTestSpace(int n, Gecode::FloatVal& d)
: x(*this, n, d.min(), d.max()) {}
FloatTestSpace(FloatTestSpace& s)
: Gecode::Space(s) {
x.update(*this, s.x);
}
virtual Gecode::Space* copy(void) {
return new FloatTestSpace(*this);
}
};
#endif
const char* int_var_branch_name[] = {
"SINGLE VARIABLE",
"INT_VAR_NONE",
"INT_VAR_RND",
"INT_VAR_MERIT_MIN",
"INT_VAR_MERIT_MAX",
"INT_VAR_DEGREE_MIN",
"INT_VAR_DEGREE_MAX",
"INT_VAR_AFC_MIN",
"INT_VAR_AFC_MAX",
"INT_VAR_ACTION_MIN",
"INT_VAR_ACTION_MAX",
"INT_VAR_CHB_MIN",
"INT_VAR_CHB_MAX",
"INT_VAR_MIN_MIN",
"INT_VAR_MIN_MAX",
"INT_VAR_MAX_MIN",
"INT_VAR_MAX_MAX",
"INT_VAR_SIZE_MIN",
"INT_VAR_SIZE_MAX",
"INT_VAR_DEGREE_SIZE_MIN",
"INT_VAR_DEGREE_SIZE_MAX",
"INT_VAR_AFC_SIZE_MIN",
"INT_VAR_AFC_SIZE_MAX",
"INT_VAR_ACTION_SIZE_MIN",
"INT_VAR_ACTION_SIZE_MAX",
"INT_VAR_CHB_SIZE_MIN",
"INT_VAR_CHB_SIZE_MAX",
"INT_VAR_REGRET_MIN_MIN",
"INT_VAR_REGRET_MIN_MAX",
"INT_VAR_REGRET_MAX_MIN",
"INT_VAR_REGRET_MAX_MAX"
};
const int n_int_var_branch =
sizeof(int_var_branch_name)/sizeof(const char*);
const char* bool_var_branch_name[] = {
"SINGLE VARIABLE",
"BOOL_VAR_NONE",
"BOOL_VAR_RND",
"BOOL_VAR_MERIT_MIN",
"BOOL_VAR_MERIT_MAX",
"BOOL_VAR_DEGREE_MIN",
"BOOL_VAR_DEGREE_MAX",
"BOOL_VAR_AFC_MIN",
"BOOL_VAR_AFC_MAX",
"BOOL_VAR_ACTION_MIN",
"BOOL_VAR_ACTION_MAX",
"BOOL_VAR_CHB_MIN",
"BOOL_VAR_CHB_MAX"
};
const int n_bool_var_branch =
sizeof(bool_var_branch_name)/sizeof(const char*);
double int_merit(const Gecode::Space&, Gecode::IntVar x, int) {
return x.min();
}
double bool_merit(const Gecode::Space&, Gecode::BoolVar x, int) {
return x.min();
}
const char* int_val_branch_name[] = {
"INT_VAL_MIN",
"INT_VAL_MED",
"INT_VAL_MAX",
"INT_VAL_RND",
"INT_VAL_SPLIT_MIN",
"INT_VAL_SPLIT_MAX",
"INT_VAL_RANGE_MIN",
"INT_VAL_RANGE_MAX",
"INT_VAL",
"INT_VALUES_MIN",
"INT_VALUES_MAX"
};
const int n_int_val_branch =
sizeof(int_val_branch_name)/sizeof(const char*);
const char* bool_val_branch_name[] = {
"BOOL_VAL_MIN",
"BOOL_VAL_MAX",
"BOOL_VAL_RND",
"BOOL_VAL"
};
const int n_bool_val_branch =
sizeof(bool_val_branch_name)/sizeof(const char*);
int int_val(const Gecode::Space&, Gecode::IntVar x, int) {
return x.min();
}
int bool_val(const Gecode::Space&, Gecode::BoolVar x, int) {
return x.min();
}
#ifdef GECODE_HAS_SET_VARS
const char* set_var_branch_name[] = {
"SINGLE VARIABLE",
"SET_VAR_NONE",
"SET_VAR_RND",
"SET_VAR_MERIT_MIN",
"SET_VAR_MERIT_MAX",
"SET_VAR_DEGREE_MIN",
"SET_VAR_DEGREE_MAX",
"SET_VAR_AFC_MIN",
"SET_VAR_AFC_MAX",
"SET_VAR_ACTION_MIN",
"SET_VAR_ACTION_MAX",
"SET_VAR_CHB_MIN",
"SET_VAR_CHB_MAX",
"SET_VAR_MIN_MIN",
"SET_VAR_MIN_MAX",
"SET_VAR_MAX_MIN",
"SET_VAR_MAX_MAX",
"SET_VAR_SIZE_MIN",
"SET_VAR_SIZE_MAX",
"SET_VAR_DEGREE_SIZE_MIN",
"SET_VAR_DEGREE_SIZE_MAX",
"SET_VAR_AFC_SIZE_MIN",
"SET_VAR_AFC_SIZE_MAX",
"SET_VAR_ACTION_SIZE_MIN",
"SET_VAR_ACTION_SIZE_MAX",
"SET_VAR_CHB_SIZE_MIN",
"SET_VAR_CHB_SIZE_MAX"
};
const int n_set_var_branch =
sizeof(set_var_branch_name)/sizeof(const char*);
double set_merit(const Gecode::Space&, Gecode::SetVar, int) {
return 2.0;
}
const char* set_val_branch_name[] = {
"SET_VAL_MIN_INC",
"SET_VAL_MIN_EXC",
"SET_VAL_MED_INC",
"SET_VAL_MED_EXC",
"SET_VAL_MAX_INC",
"SET_VAL_MAX_EXC",
"SET_VAL_RND_INC",
"SET_VAL_RND_EXC",
"SET_VAL"
};
const int n_set_val_branch =
sizeof(set_val_branch_name)/sizeof(const char*);
int set_val(const Gecode::Space&, Gecode::SetVar x, int) {
Gecode::SetVarUnknownRanges r(x);
return r.min();
}
#endif
#ifdef GECODE_HAS_FLOAT_VARS
const char* float_var_branch_name[] = {
"SINGLE VARIABLE",
"FLOAT_VAR_NONE",
"FLOAT_VAR_RND",
"FLOAT_VAR_MERIT_MIN",
"FLOAT_VAR_MERIT_MAX",
"FLOAT_VAR_DEGREE_MIN",
"FLOAT_VAR_DEGREE_MAX",
"FLOAT_VAR_AFC_MIN",
"FLOAT_VAR_AFC_MAX",
"FLOAT_VAR_ACTION_MIN",
"FLOAT_VAR_ACTION_MAX",
"FLOAT_VAR_CHB_MIN",
"FLOAT_VAR_CHB_MAX",
"FLOAT_VAR_MIN_MIN",
"FLOAT_VAR_MIN_MAX",
"FLOAT_VAR_MAX_MIN",
"FLOAT_VAR_MAX_MAX",
"FLOAT_VAR_SIZE_MIN",
"FLOAT_VAR_SIZE_MAX",
"FLOAT_VAR_DEGREE_SIZE_MIN",
"FLOAT_VAR_DEGREE_SIZE_MAX",
"FLOAT_VAR_AFC_SIZE_MIN",
"FLOAT_VAR_AFC_SIZE_MAX",
"FLOAT_VAR_ACTION_SIZE_MIN",
"FLOAT_VAR_ACTION_SIZE_MAX",
"FLOAT_VAR_CHB_SIZE_MIN",
"FLOAT_VAR_CHB_SIZE_MAX"
};
const int n_float_var_branch =
sizeof(float_var_branch_name)/sizeof(const char*);
double float_merit(const Gecode::Space&, Gecode::FloatVar x, int) {
return static_cast<double>(x.degree());
}
const char* float_val_branch_name[] = {
"FLOAT_VAL_SPLIT_MIN",
"FLOAT_VAL_SPLIT_MAX",
"FLOAT_VAL_SPLIT_RND",
"FLOAT_VAL"
};
const int n_float_val_branch =
sizeof(float_val_branch_name)/sizeof(const char*);
Gecode::FloatNumBranch float_val(const Gecode::Space&,
Gecode::FloatVar x, int) {
Gecode::FloatNumBranch nl; nl.n=x.med(); nl.l=true;
return nl;
}
#endif
class RunInfo {
public:
std::string var, val;
unsigned int a_d, c_d;
RunInfo(const std::string& vara, const std::string& varb,
const std::string& valname,
const Gecode::Search::Options& o)
: var(vara + "::" + varb), val(valname), a_d(o.a_d), c_d(o.c_d) {}
void print(std::ostream& o) const {
o << "(" << var << ", " << val << ", " << a_d << ", " << c_d << ")";
}
};
}}
std::ostream&
operator<<(std::ostream& os, const Test::Branch::RunInfo& ri) {
ri.print(os);
return os;
}
namespace Test { namespace Branch {
template<class TestSpace>
int solutions(TestSpace* c, Gecode::Search::Options& o, int maxNbSol = -1) {
o.a_d = Base::rand(10);
o.c_d = Base::rand(10);
Gecode::DFS<TestSpace> e_s(c, o);
delete c;
// Find number of solutions
int s = 0;
do {
Gecode::Space* ex = e_s.next();
if (ex == NULL) break;
delete ex;
++s;
if ((maxNbSol >= 0) && (maxNbSol == s)) break;
} while (true);
return s;
}
IntTest::IntTest(const std::string& s, int a, const Gecode::IntSet& d)
: Base("Int::Branch::"+s), arity(a), dom(d) {
}
bool
IntTest::run(void) {
using std::map;
using std::vector;
using std::string;
using std::ostream;
using namespace Gecode;
// Results of tests run
map<int, vector<RunInfo> > results;
// Set up root space
IntTestSpace* root = new IntTestSpace(arity,dom);
post(*root, root->x);
results.clear();
IntArgs d(arity);
for (int i=arity; i--; )
d[i]=i;
for (int vara = 0; vara<n_int_var_branch; vara++) {
for (int varb = 1; varb<n_int_var_branch; varb++) {
for (int val = 0; val<n_int_val_branch; val++) {
Rnd r(1);
IntValBranch ivb;
switch (val) {
case 0: ivb = INT_VAL_MIN(); break;
case 1: ivb = INT_VAL_MED(); break;
case 2: ivb = INT_VAL_MAX(); break;
case 3: ivb = INT_VAL_RND(r); break;
case 4: ivb = INT_VAL_SPLIT_MIN(); break;
case 5: ivb = INT_VAL_SPLIT_MAX(); break;
case 6: ivb = INT_VAL_RANGE_MIN(); break;
case 7: ivb = INT_VAL_RANGE_MAX(); break;
case 8: ivb = INT_VAL(&int_val); break;
case 9: ivb = INT_VALUES_MIN(); break;
case 10: ivb = INT_VALUES_MAX(); break;
}
IntTestSpace* c = static_cast<IntTestSpace*>(root->clone());
if ((vara == 0) && (val < 11)) {
for (int i=0; i<c->x.size(); i++)
branch(*c, c->x[i], ivb);
} else {
Rnd ra(1);
IntVarBranch ivba;
IntAction iaa(*c, c->x, 0.9);
IntCHB ica(*c, c->x);
switch (vara) {
case 0: ivba = INT_VAR_NONE(); break;
case 1: ivba = INT_VAR_NONE(); break;
case 2: ivba = INT_VAR_RND(ra); break;
case 3: ivba = INT_VAR_MERIT_MIN(&int_merit); break;
case 4: ivba = INT_VAR_MERIT_MAX(&int_merit); break;
case 5: ivba = INT_VAR_DEGREE_MIN(); break;
case 6: ivba = INT_VAR_DEGREE_MAX(); break;
case 7: ivba = INT_VAR_AFC_MIN(0.5); break;
case 8: ivba = INT_VAR_AFC_MAX(0.5); break;
case 9: ivba = INT_VAR_ACTION_MIN(iaa); break;
case 10: ivba = INT_VAR_ACTION_MAX(iaa); break;
case 11: ivba = INT_VAR_CHB_MIN(ica); break;
case 12: ivba = INT_VAR_CHB_MAX(ica); break;
case 13: ivba = INT_VAR_MIN_MIN(); break;
case 14: ivba = INT_VAR_MIN_MAX(); break;
case 15: ivba = INT_VAR_MAX_MIN(); break;
case 16: ivba = INT_VAR_MAX_MAX(); break;
case 17: ivba = INT_VAR_SIZE_MIN(); break;
case 18: ivba = INT_VAR_SIZE_MAX(); break;
case 19: ivba = INT_VAR_DEGREE_SIZE_MIN(); break;
case 20: ivba = INT_VAR_DEGREE_SIZE_MAX(); break;
case 21: ivba = INT_VAR_AFC_SIZE_MIN(); break;
case 22: ivba = INT_VAR_AFC_SIZE_MAX(); break;
case 23: ivba = INT_VAR_ACTION_SIZE_MIN(iaa); break;
case 24: ivba = INT_VAR_ACTION_SIZE_MAX(iaa); break;
case 25: ivba = INT_VAR_CHB_SIZE_MIN(ica); break;
case 26: ivba = INT_VAR_CHB_SIZE_MAX(ica); break;
case 27: ivba = INT_VAR_REGRET_MIN_MIN(); break;
case 28: ivba = INT_VAR_REGRET_MIN_MAX(); break;
case 29: ivba = INT_VAR_REGRET_MAX_MIN(); break;
case 30: ivba = INT_VAR_REGRET_MAX_MAX(); break;
}
Rnd rb(2);
IntVarBranch ivbb;
IntAction iab(*c, c->x, 0.9, &int_merit);
IntCHB icb(*c, c->x, &int_merit);
switch (varb) {
case 0: ivbb = INT_VAR_NONE(); break;
case 1: ivbb = INT_VAR_NONE(); break;
case 2: ivbb = INT_VAR_RND(rb); break;
case 3: ivbb = INT_VAR_MERIT_MIN(&int_merit,&tbl); break;
case 4: ivbb = INT_VAR_MERIT_MAX(&int_merit,&tbl); break;
case 5: ivbb = INT_VAR_DEGREE_MIN(&tbl); break;
case 6: ivbb = INT_VAR_DEGREE_MAX(&tbl); break;
case 7: ivbb = INT_VAR_AFC_MIN(0.5,&tbl); break;
case 8: ivbb = INT_VAR_AFC_MAX(0.5,&tbl); break;
case 9: ivbb = INT_VAR_ACTION_MIN(iab,&tbl); break;
case 10: ivbb = INT_VAR_ACTION_MAX(iab,&tbl); break;
case 11: ivbb = INT_VAR_CHB_MIN(icb,&tbl); break;
case 12: ivbb = INT_VAR_CHB_MAX(icb,&tbl); break;
case 13: ivbb = INT_VAR_MIN_MIN(&tbl); break;
case 14: ivbb = INT_VAR_MIN_MAX(&tbl); break;
case 15: ivbb = INT_VAR_MAX_MIN(&tbl); break;
case 16: ivbb = INT_VAR_MAX_MAX(&tbl); break;
case 17: ivbb = INT_VAR_SIZE_MIN(&tbl); break;
case 18: ivbb = INT_VAR_SIZE_MAX(&tbl); break;
case 19: ivbb = INT_VAR_DEGREE_SIZE_MIN(&tbl); break;
case 20: ivbb = INT_VAR_DEGREE_SIZE_MAX(&tbl); break;
case 21: ivbb = INT_VAR_AFC_SIZE_MIN(1.0,&tbl); break;
case 22: ivbb = INT_VAR_AFC_SIZE_MAX(1.0,&tbl); break;
case 23: ivbb = INT_VAR_ACTION_SIZE_MIN(iab,&tbl); break;
case 24: ivbb = INT_VAR_ACTION_SIZE_MAX(iab,&tbl); break;
case 25: ivbb = INT_VAR_CHB_SIZE_MIN(icb,&tbl); break;
case 26: ivbb = INT_VAR_CHB_SIZE_MAX(icb,&tbl); break;
case 27: ivbb = INT_VAR_REGRET_MIN_MIN(&tbl); break;
case 28: ivbb = INT_VAR_REGRET_MIN_MAX(&tbl); break;
case 29: ivbb = INT_VAR_REGRET_MAX_MIN(&tbl); break;
case 30: ivbb = INT_VAR_REGRET_MAX_MAX(&tbl); break;
}
switch (Base::rand(9U)) {
case 0U:
branch(*c, c->x, ivba, ivb); break;
case 1U:
branch(*c, c->x, ivbb, ivb); break;
case 2U:
branch(*c, c->x, tiebreak(ivba,ivbb), ivb); break;
case 3U:
branch(*c, c->x, tiebreak(ivbb,ivba), ivb); break;
case 4U:
branch(*c, c->x, tiebreak(ivba,ivba,ivbb), ivb); break;
case 5U:
branch(*c, c->x, tiebreak(ivba,ivbb,ivbb), ivb); break;
case 6U:
branch(*c, c->x, tiebreak(ivbb,ivba,ivba), ivb); break;
case 7U:
branch(*c, c->x, tiebreak(ivba,ivba,ivbb,ivba), ivb); break;
case 8U:
branch(*c, c->x, tiebreak(ivbb,ivba,ivbb,ivba), ivb); break;
}
}
Gecode::Search::Options o;
results[solutions(c,o)].push_back
(RunInfo(int_var_branch_name[vara],
int_var_branch_name[varb],
int_val_branch_name[val],
o));
}
}
}
if (results.size() > 1)
goto failed;
delete root;
return true;
failed:
std::cout << "FAILURE" << std::endl;
for (map<int, vector<RunInfo> >::iterator it = results.begin();
it != results.end(); ++it) {
std::cout << "Number of solutions: " << it->first << std::endl;
for (unsigned int i = 0; i < it->second.size(); ++i)
std::cout << it->second[i] << " ";
std::cout << std::endl;
}
delete root;
return results.size() == 1;
}
BoolTest::BoolTest(const std::string& s, int a)
: Base("Bool::Branch::"+s), arity(a) {
}
bool
BoolTest::run(void) {
using std::map;
using std::vector;
using std::string;
using std::ostream;
using namespace Gecode;
// Results of tests run
map<int, vector<RunInfo> > results;
// Set up root space
BoolTestSpace* root = new BoolTestSpace(arity);
post(*root, root->x);
results.clear();
for (int vara = 0; vara<n_bool_var_branch; vara++) {
for (int varb = 1; varb<n_bool_var_branch; varb++) {
for (int val = 0; val<n_bool_val_branch; val++) {
Rnd r(1);
BoolValBranch bvb;
switch (val) {
case 0: bvb = BOOL_VAL_MIN(); break;
case 1: bvb = BOOL_VAL_MAX(); break;
case 2: bvb = BOOL_VAL_RND(r); break;
case 3: bvb = BOOL_VAL(&bool_val); break;
}
BoolTestSpace* c = static_cast<BoolTestSpace*>(root->clone());
if (vara == 0) {
for (int i=0; i<c->x.size(); i++)
branch(*c, c->x[i], bvb);
} else {
Rnd ra(1);
BoolVarBranch bvba;
BoolAction baa(*c, c->x, 0.9);
BoolCHB bca(*c, c->x);
switch (vara) {
case 0: bvba = BOOL_VAR_NONE(); break;
case 1: bvba = BOOL_VAR_NONE(); break;
case 2: bvba = BOOL_VAR_RND(ra); break;
case 3: bvba = BOOL_VAR_MERIT_MIN(&bool_merit); break;
case 4: bvba = BOOL_VAR_MERIT_MAX(&bool_merit); break;
case 5: bvba = BOOL_VAR_DEGREE_MIN(); break;
case 6: bvba = BOOL_VAR_DEGREE_MAX(); break;
case 7: bvba = BOOL_VAR_AFC_MIN(0.5); break;
case 8: bvba = BOOL_VAR_AFC_MAX(0.5); break;
case 9: bvba = BOOL_VAR_ACTION_MIN(baa); break;
case 10: bvba = BOOL_VAR_ACTION_MAX(baa); break;
case 11: bvba = BOOL_VAR_CHB_MIN(bca); break;
case 12: bvba = BOOL_VAR_CHB_MAX(bca); break;
}
Rnd rb(2);
BoolVarBranch bvbb;
BoolAction bab(*c, c->x, 0.9, &bool_merit);
BoolCHB bcb(*c, c->x, &bool_merit);
switch (varb) {
case 0: bvbb = BOOL_VAR_NONE(); break;
case 1: bvbb = BOOL_VAR_NONE(); break;
case 2: bvbb = BOOL_VAR_RND(rb); break;
case 3: bvbb = BOOL_VAR_MERIT_MIN(&bool_merit,&tbl); break;
case 4: bvbb = BOOL_VAR_MERIT_MAX(&bool_merit,&tbl); break;
case 5: bvbb = BOOL_VAR_DEGREE_MIN(&tbl); break;
case 6: bvbb = BOOL_VAR_DEGREE_MAX(&tbl); break;
case 7: bvbb = BOOL_VAR_AFC_MIN(0.5,&tbl); break;
case 8: bvbb = BOOL_VAR_AFC_MAX(0.5,&tbl); break;
case 9: bvbb = BOOL_VAR_ACTION_MIN(bab,&tbl); break;
case 10: bvbb = BOOL_VAR_ACTION_MAX(bab,&tbl); break;
case 11: bvbb = BOOL_VAR_CHB_MIN(bcb,&tbl); break;
case 12: bvbb = BOOL_VAR_CHB_MAX(bcb,&tbl); break;
}
switch (Base::rand(9U)) {
case 0U:
branch(*c, c->x, bvba, bvb); break;
case 1U:
branch(*c, c->x, bvbb, bvb); break;
case 2U:
branch(*c, c->x, tiebreak(bvba,bvbb), bvb); break;
case 3U:
branch(*c, c->x, tiebreak(bvbb,bvba), bvb); break;
case 4U:
branch(*c, c->x, tiebreak(bvba,bvba,bvbb), bvb); break;
case 5U:
branch(*c, c->x, tiebreak(bvba,bvbb,bvbb), bvb); break;
case 6U:
branch(*c, c->x, tiebreak(bvbb,bvba,bvba), bvb); break;
case 7U:
branch(*c, c->x, tiebreak(bvba,bvba,bvbb,bvba), bvb); break;
case 8U:
branch(*c, c->x, tiebreak(bvbb,bvba,bvbb,bvba), bvb); break;
}
}
Gecode::Search::Options o;
results[solutions(c,o)].push_back
(RunInfo(int_var_branch_name[vara],
int_var_branch_name[varb],
int_val_branch_name[val],
o));
}
}
}
if (results.size() > 1)
goto failed;
delete root;
return true;
failed:
std::cout << "FAILURE" << std::endl;
for (map<int, vector<RunInfo> >::iterator it = results.begin();
it != results.end(); ++it) {
std::cout << "Number of solutions: " << it->first << std::endl;
for (unsigned int i = 0; i < it->second.size(); ++i)
std::cout << it->second[i] << " ";
std::cout << std::endl;
}
delete root;
return results.size() == 1;
}
#ifdef GECODE_HAS_SET_VARS
SetTest::SetTest(const std::string& s, int a, const Gecode::IntSet& d)
: Base("Set::Branch::"+s), arity(a), dom(d) {
}
bool
SetTest::run(void) {
using std::map;
using std::vector;
using std::string;
using std::ostream;
using namespace Gecode;
// Results of tests run
map<int, vector<RunInfo> > results;
// Set up root space
SetTestSpace* root = new SetTestSpace(arity,dom);
post(*root, root->x);
root->status();
results.clear();
for (int vara = 0; vara<n_set_var_branch; vara++) {
for (int varb = 1; varb<n_set_var_branch; varb++) {
for (int val = 0; val<n_set_val_branch; val++) {
Rnd r(1);
SetValBranch svb;
switch (val) {
case 0: svb = SET_VAL_MIN_INC(); break;
case 1: svb = SET_VAL_MIN_EXC(); break;
case 2: svb = SET_VAL_MED_INC(); break;
case 3: svb = SET_VAL_MED_EXC(); break;
case 4: svb = SET_VAL_MAX_INC(); break;
case 5: svb = SET_VAL_MAX_EXC(); break;
case 6: svb = SET_VAL_RND_INC(r); break;
case 7: svb = SET_VAL_RND_EXC(r); break;
case 8: svb = SET_VAL(&set_val); break;
}
SetTestSpace* c = static_cast<SetTestSpace*>(root->clone());
if (vara == 0) {
for (int i=0; i<c->x.size(); i++)
branch(*c, c->x[i], svb);
} else {
Rnd ra(1);
SetVarBranch svba;
SetAction saa(*c, c->x, 0.9);
SetCHB sca(*c, c->x);
switch (vara) {
case 0: break;
case 1: svba = SET_VAR_NONE(); break;
case 2: svba = SET_VAR_RND(ra); break;
case 3: svba = SET_VAR_MERIT_MIN(&set_merit); break;
case 4: svba = SET_VAR_MERIT_MAX(&set_merit); break;
case 5: svba = SET_VAR_DEGREE_MIN(); break;
case 6: svba = SET_VAR_DEGREE_MAX(); break;
case 7: svba = SET_VAR_AFC_MIN(0.5); break;
case 8: svba = SET_VAR_AFC_MAX(0.5); break;
case 9: svba = SET_VAR_ACTION_MIN(saa); break;
case 10: svba = SET_VAR_ACTION_MAX(saa); break;
case 11: svba = SET_VAR_CHB_MIN(sca); break;
case 12: svba = SET_VAR_CHB_MAX(sca); break;
case 13: svba = SET_VAR_MIN_MIN(); break;
case 14: svba = SET_VAR_MIN_MAX(); break;
case 15: svba = SET_VAR_MAX_MIN(); break;
case 16: svba = SET_VAR_MAX_MAX(); break;
case 17: svba = SET_VAR_SIZE_MIN(); break;
case 18: svba = SET_VAR_SIZE_MAX(); break;
case 19: svba = SET_VAR_DEGREE_SIZE_MIN(); break;
case 20: svba = SET_VAR_DEGREE_SIZE_MAX(); break;
case 21: svba = SET_VAR_AFC_SIZE_MIN(); break;
case 22: svba = SET_VAR_AFC_SIZE_MAX(); break;
case 23: svba = SET_VAR_ACTION_SIZE_MIN(saa); break;
case 24: svba = SET_VAR_ACTION_SIZE_MAX(saa); break;
case 25: svba = SET_VAR_CHB_SIZE_MIN(sca); break;
case 26: svba = SET_VAR_CHB_SIZE_MAX(sca); break;
}
Rnd rb(2);
SetVarBranch svbb;
SetAction sab(*c, c->x, 0.9, &set_merit);
SetCHB scb(*c, c->x, &set_merit);
switch (varb) {
case 0: break;
case 1: svbb = SET_VAR_NONE(); break;
case 2: svbb = SET_VAR_RND(rb); break;
case 3: svbb = SET_VAR_MERIT_MIN(&set_merit,&tbl); break;
case 4: svbb = SET_VAR_MERIT_MAX(&set_merit,&tbl); break;
case 5: svbb = SET_VAR_DEGREE_MIN(&tbl); break;
case 6: svbb = SET_VAR_DEGREE_MAX(&tbl); break;
case 7: svbb = SET_VAR_AFC_MIN(0.5,&tbl); break;
case 8: svbb = SET_VAR_AFC_MAX(0.5,&tbl); break;
case 9: svbb = SET_VAR_ACTION_MIN(sab,&tbl); break;
case 10: svbb = SET_VAR_ACTION_MAX(sab,&tbl); break;
case 11: svbb = SET_VAR_CHB_MIN(scb,&tbl); break;
case 12: svbb = SET_VAR_CHB_MAX(scb,&tbl); break;
case 13: svbb = SET_VAR_MIN_MIN(&tbl); break;
case 14: svbb = SET_VAR_MIN_MAX(&tbl); break;
case 15: svbb = SET_VAR_MAX_MIN(&tbl); break;
case 16: svbb = SET_VAR_MAX_MAX(&tbl); break;
case 17: svbb = SET_VAR_SIZE_MIN(&tbl); break;
case 18: svbb = SET_VAR_SIZE_MAX(&tbl); break;
case 19: svbb = SET_VAR_DEGREE_SIZE_MIN(&tbl); break;
case 20: svbb = SET_VAR_DEGREE_SIZE_MAX(&tbl); break;
case 21: svbb = SET_VAR_AFC_SIZE_MIN(1.0,&tbl); break;
case 22: svbb = SET_VAR_AFC_SIZE_MAX(1.0,&tbl); break;
case 23: svbb = SET_VAR_ACTION_SIZE_MIN(sab,&tbl); break;
case 24: svbb = SET_VAR_ACTION_SIZE_MAX(sab,&tbl); break;
case 25: svbb = SET_VAR_CHB_SIZE_MIN(scb,&tbl); break;
case 26: svbb = SET_VAR_CHB_SIZE_MAX(scb,&tbl); break;
}
switch (Base::rand(9U)) {
case 0U:
branch(*c, c->x, svba, svb); break;
case 1U:
branch(*c, c->x, svbb, svb); break;
case 2U:
branch(*c, c->x, tiebreak(svba,svbb), svb); break;
case 3U:
branch(*c, c->x, tiebreak(svbb,svba), svb); break;
case 4U:
branch(*c, c->x, tiebreak(svba,svba,svbb), svb); break;
case 5U:
branch(*c, c->x, tiebreak(svba,svbb,svbb), svb); break;
case 6U:
branch(*c, c->x, tiebreak(svbb,svba,svba), svb); break;
case 7U:
branch(*c, c->x, tiebreak(svba,svba,svbb,svba), svb); break;
case 8U:
branch(*c, c->x, tiebreak(svbb,svba,svbb,svba), svb); break;
}
}
Gecode::Search::Options o;
results[solutions(c,o)].push_back
(RunInfo(set_var_branch_name[vara],
set_var_branch_name[varb],
set_val_branch_name[val],
o));
}
}
}
if (results.size() > 1)
goto failed;
delete root;
return true;
failed:
std::cout << "FAILURE" << std::endl;
for (map<int, vector<RunInfo> >::iterator it = results.begin();
it != results.end(); ++it) {
std::cout << "Number of solutions: " << it->first << std::endl;
for (unsigned int i = 0; i < it->second.size(); ++i)
std::cout << it->second[i] << " ";
std::cout << std::endl;
}
delete root;
return results.size() == 1;
}
#endif
#ifdef GECODE_HAS_FLOAT_VARS
FloatTest::FloatTest(const std::string& s, int a, const Gecode::FloatVal& d, int nbs)
: Base("Float::Branch::"+s), arity(a), dom(d), nbSols(nbs) {
}
bool
FloatTest::run(void) {
using std::map;
using std::vector;
using std::string;
using std::ostream;
using namespace Gecode;
// Results of tests run
map<int, vector<RunInfo> > results;
// Set up root space
FloatTestSpace* root = new FloatTestSpace(arity,dom);
post(*root, root->x);
root->status();
results.clear();
for (int vara = 0; vara<n_float_var_branch; vara++) {
for (int varb = 1; varb<n_float_var_branch; varb++) {
for (int val = 0; val<n_float_val_branch; val++) {
Rnd r(1);
FloatValBranch fvb;
switch (val) {
case 0: fvb = FLOAT_VAL_SPLIT_MIN(); break;
case 1: fvb = FLOAT_VAL_SPLIT_MAX(); break;
case 2: fvb = FLOAT_VAL_SPLIT_RND(r); break;
case 3: fvb = FLOAT_VAL(&float_val); break;
}
FloatTestSpace* c = static_cast<FloatTestSpace*>(root->clone());
if (vara == 0) {
for (int i=0; i<c->x.size(); i++)
branch(*c, c->x[i], fvb);
} else {
Rnd ra(1);
FloatVarBranch fvba;
FloatAction faa(*c, c->x, 0.9);
FloatCHB fca(*c, c->x);
switch (vara) {
case 0: break;
case 1: fvba = FLOAT_VAR_NONE(); break;
case 2: fvba = FLOAT_VAR_RND(ra); break;
case 3: fvba = FLOAT_VAR_MERIT_MIN(&float_merit); break;
case 4: fvba = FLOAT_VAR_MERIT_MAX(&float_merit); break;
case 5: fvba = FLOAT_VAR_DEGREE_MIN(); break;
case 6: fvba = FLOAT_VAR_DEGREE_MAX(); break;
case 7: fvba = FLOAT_VAR_AFC_MIN(0.5); break;
case 8: fvba = FLOAT_VAR_AFC_MAX(0.5); break;
case 9: fvba = FLOAT_VAR_ACTION_MIN(faa); break;
case 10: fvba = FLOAT_VAR_ACTION_MAX(faa); break;
case 11: fvba = FLOAT_VAR_CHB_MIN(fca); break;
case 12: fvba = FLOAT_VAR_CHB_MAX(fca); break;
case 13: fvba = FLOAT_VAR_MIN_MIN(); break;
case 14: fvba = FLOAT_VAR_MIN_MAX(); break;
case 15: fvba = FLOAT_VAR_MAX_MIN(); break;
case 16: fvba = FLOAT_VAR_MAX_MAX(); break;
case 17: fvba = FLOAT_VAR_SIZE_MIN(); break;
case 18: fvba = FLOAT_VAR_SIZE_MAX(); break;
case 19: fvba = FLOAT_VAR_DEGREE_SIZE_MIN(); break;
case 20: fvba = FLOAT_VAR_DEGREE_SIZE_MAX(); break;
case 21: fvba = FLOAT_VAR_AFC_SIZE_MIN(); break;
case 22: fvba = FLOAT_VAR_AFC_SIZE_MAX(); break;
case 23: fvba = FLOAT_VAR_ACTION_SIZE_MIN(faa); break;
case 24: fvba = FLOAT_VAR_ACTION_SIZE_MAX(faa); break;
case 25: fvba = FLOAT_VAR_CHB_SIZE_MIN(fca); break;
case 26: fvba = FLOAT_VAR_CHB_SIZE_MAX(fca); break;
}
Rnd rb(2);
FloatVarBranch fvbb;
FloatAction fab(*c, c->x, 0.9, &float_merit);
FloatCHB fcb(*c, c->x, &float_merit);
switch (varb) {
case 0: break;
case 1: fvbb = FLOAT_VAR_NONE(); break;
case 2: fvbb = FLOAT_VAR_RND(rb); break;
case 3: fvbb = FLOAT_VAR_MERIT_MIN(&float_merit,&tbl); break;
case 4: fvbb = FLOAT_VAR_MERIT_MAX(&float_merit,&tbl); break;
case 5: fvbb = FLOAT_VAR_DEGREE_MIN(&tbl); break;
case 6: fvbb = FLOAT_VAR_DEGREE_MAX(&tbl); break;
case 7: fvbb = FLOAT_VAR_AFC_MIN(0.5,&tbl); break;
case 8: fvbb = FLOAT_VAR_AFC_MAX(0.5,&tbl); break;
case 9: fvbb = FLOAT_VAR_ACTION_MIN(fab,&tbl); break;
case 10: fvbb = FLOAT_VAR_ACTION_MAX(fab,&tbl); break;
case 11: fvbb = FLOAT_VAR_CHB_MIN(fcb,&tbl); break;
case 12: fvbb = FLOAT_VAR_CHB_MAX(fcb,&tbl); break;
case 13: fvbb = FLOAT_VAR_MIN_MIN(&tbl); break;
case 14: fvbb = FLOAT_VAR_MIN_MAX(&tbl); break;
case 15: fvbb = FLOAT_VAR_MAX_MIN(&tbl); break;
case 16: fvbb = FLOAT_VAR_MAX_MAX(&tbl); break;
case 17: fvbb = FLOAT_VAR_SIZE_MIN(&tbl); break;
case 18: fvbb = FLOAT_VAR_SIZE_MAX(&tbl); break;
case 19: fvbb = FLOAT_VAR_DEGREE_SIZE_MIN(&tbl); break;
case 20: fvbb = FLOAT_VAR_DEGREE_SIZE_MAX(&tbl); break;
case 21: fvbb = FLOAT_VAR_AFC_SIZE_MIN(1.0,&tbl); break;
case 22: fvbb = FLOAT_VAR_AFC_SIZE_MAX(1.0,&tbl); break;
case 23: fvbb = FLOAT_VAR_ACTION_SIZE_MIN(fab,&tbl); break;
case 24: fvbb = FLOAT_VAR_ACTION_SIZE_MAX(fab,&tbl); break;
case 25: fvbb = FLOAT_VAR_CHB_SIZE_MIN(fcb,&tbl); break;
case 26: fvbb = FLOAT_VAR_CHB_SIZE_MAX(fcb,&tbl); break;
}
switch (Base::rand(9U)) {
case 0U:
branch(*c, c->x, fvba, fvb); break;
case 1U:
branch(*c, c->x, fvbb, fvb); break;
case 2U:
branch(*c, c->x, tiebreak(fvba,fvbb), fvb); break;
case 3U:
branch(*c, c->x, tiebreak(fvbb,fvba), fvb); break;
case 4U:
branch(*c, c->x, tiebreak(fvba,fvba,fvbb), fvb); break;
case 5U:
branch(*c, c->x, tiebreak(fvba,fvbb,fvbb), fvb); break;
case 6U:
branch(*c, c->x, tiebreak(fvbb,fvba,fvba), fvb); break;
case 7U:
branch(*c, c->x, tiebreak(fvba,fvba,fvbb,fvba), fvb); break;
case 8U:
branch(*c, c->x, tiebreak(fvbb,fvba,fvbb,fvba), fvb); break;
}
}
Gecode::Search::Options o;
results[solutions(c,o,nbSols)].push_back
(RunInfo(float_var_branch_name[vara],
float_var_branch_name[varb],
float_val_branch_name[val],
o));
}
}
}
if (results.size() > 1)
goto failed;
delete root;
return true;
failed:
std::cout << "FAILURE" << std::endl;
for (map<int, vector<RunInfo> >::iterator it = results.begin();
it != results.end(); ++it) {
std::cout << "Number of solutions: " << it->first << std::endl;
for (unsigned int i = 0; i < it->second.size(); ++i)
std::cout << it->second[i] << " ";
std::cout << std::endl;
}
delete root;
return results.size() == 1;
}
#endif
}}
// STATISTICS: test-branch
Gecode::ArgArrayBase::size
int size(void) const
Return size of array (number of elements).
Definition array.hpp:1607
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::BoolVarArray
Boolean variable array.
Definition int.hh:808
Gecode::BoolVarBranch
Which Boolean variable to select for branching.
Definition int.hh:4656
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::DFS
Depth-first search engine.
Definition search.hh:1036
Gecode::FloatAction
Recording actions for float variables.
Definition float.hh:1555
Gecode::FloatCHB
Recording CHB for float variables.
Definition float.hh:1607
Gecode::FloatNumBranch
Value description class for branching.
Definition float.hh:1462
Gecode::FloatNumBranch::l
bool l
Whether to try the lower or upper half first.
Definition float.hh:1467
Gecode::FloatNumBranch::n
FloatNum n
The middle value for branching.
Definition float.hh:1465
Gecode::FloatValBranch
Which values to select for branching first.
Definition float.hh:1820
Gecode::FloatVal
Float value type.
Definition float.hh:334
Gecode::FloatVal::x
FloatValImpType x
Implementation of float value.
Definition float.hh:425
Gecode::FloatVarArray
Float variable array.
Definition float.hh:1030
Gecode::FloatVarBranch
Which variable to select for branching.
Definition float.hh:1668
Gecode::FloatVar
Float variables.
Definition float.hh:870
Gecode::IntAction
Recording actions for integer variables.
Definition int.hh:4362
Gecode::IntArgs
Passing integer arguments.
Definition int.hh:628
Gecode::IntCHB
Recording CHB for integer variables.
Definition int.hh:4458
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::IntValBranch
Which values to select for branching first.
Definition int.hh:4854
Gecode::IntVarArray
Integer variable array.
Definition int.hh:763
Gecode::IntVarBranch
Which integer variable to select for branching.
Definition int.hh:4570
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::Rnd
Random number generator.
Definition rnd.hpp:42
Gecode::Search::Base::next
virtual T * next(void)
Return next solution (NULL, if none exists or search has been stopped).
Definition base.hpp:46
Gecode::Search::Options
Search engine options
Definition search.hh:746
Gecode::Search::Options::c_d
unsigned int c_d
Create a clone after every c_d commits (commit distance).
Definition search.hh:753
Gecode::Search::Options::a_d
unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance).
Definition search.hh:755
Gecode::SetAction
Recording actions for set variables.
Definition set.hh:1183
Gecode::SetCHB
Recording CHB for set variables.
Definition set.hh:1235
Gecode::SetValBranch
Which values to select for branching first.
Definition set.hh:1447
Gecode::SetVarArray
Set variable array
Definition set.hh:570
Gecode::SetVarBranch
Which variable to select for branching.
Definition set.hh:1296
Gecode::SetVarUnknownRanges
Iterator for the unknown ranges of a set variable.
Definition set.hh:334
Gecode::SetVar
Set variables
Definition set.hh:127
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Test::Base::rand
static Gecode::Support::RandomGenerator rand
Random number generator.
Definition test.hh:134
Test::Base::Base
Base(const std::string &s)
Create and register test with name s.
Definition test.cpp:59
Test::Branch::BoolTestSpace
Space for executing Boolean tests.
Definition branch.cpp:91
Test::Branch::BoolTestSpace::BoolTestSpace
BoolTestSpace(BoolTestSpace &s)
Constructor for cloning s.
Definition branch.cpp:99
Test::Branch::BoolTestSpace::BoolTestSpace
BoolTestSpace(int n)
Initialize test space.
Definition branch.cpp:96
Test::Branch::BoolTestSpace::x
Gecode::BoolVarArray x
Variables to be tested.
Definition branch.cpp:94
Test::Branch::BoolTestSpace::copy
virtual Gecode::Space * copy(void)
Copy space during cloning.
Definition branch.cpp:104
Test::Branch::BoolTest::BoolTest
BoolTest(const std::string &s, int a)
Construct and register test.
Definition branch.cpp:604
Test::Branch::BoolTest::arity
int arity
Number of variables.
Definition branch.hh:88
Test::Branch::BoolTest::run
virtual bool run(void)
Perform test.
Definition branch.cpp:609
Test::Branch::BoolTest::post
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post propagators on variables x.
Test::Branch::FloatTestSpace
Space for executing Float tests.
Definition branch.cpp:132
Test::Branch::FloatTestSpace::n_float_var_branch
const int n_float_var_branch
Number of float variable selections.
Definition branch.cpp:360
Test::Branch::FloatTestSpace::float_val
Gecode::FloatNumBranch float_val(const Gecode::Space &, Gecode::FloatVar x, int)
Test function for branch value function.
Definition branch.cpp:377
Test::Branch::FloatTestSpace::float_val_branch_name
const char * float_val_branch_name[]
Names for float value selections.
Definition branch.cpp:367
Test::Branch::FloatTestSpace::FloatTestSpace
FloatTestSpace(FloatTestSpace &s)
Constructor for cloning s.
Definition branch.cpp:140
Test::Branch::FloatTestSpace::float_merit
double float_merit(const Gecode::Space &, Gecode::FloatVar x, int)
Test function for branch merit function.
Definition branch.cpp:363
Test::Branch::FloatTestSpace::x
Gecode::FloatVarArray x
Variables to be tested.
Definition branch.cpp:135
Test::Branch::FloatTestSpace::float_var_branch_name
const char * float_var_branch_name[]
Names for float variable selections.
Definition branch.cpp:330
Test::Branch::FloatTestSpace::n_float_val_branch
const int n_float_val_branch
Number of float value selections.
Definition branch.cpp:374
Test::Branch::FloatTestSpace::FloatTestSpace
FloatTestSpace(int n, Gecode::FloatVal &d)
Initialize test space.
Definition branch.cpp:137
Test::Branch::FloatTestSpace::copy
virtual Gecode::Space * copy(void)
Copy space during cloning.
Definition branch.cpp:145
Test::Branch::FloatTest::dom
Gecode::FloatVal dom
Domain of variables.
Definition branch.hh:129
Test::Branch::FloatTest::arity
int arity
Number of variables.
Definition branch.hh:127
Test::Branch::FloatTest::nbSols
int nbSols
Maximum number of solutions searched during solving.
Definition branch.hh:131
Test::Branch::FloatTest::FloatTest
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d, int nbs)
Construct and register test.
Definition branch.cpp:898
Test::Branch::FloatTest::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post propagators on variables x.
Test::Branch::FloatTest::run
virtual bool run(void)
Perform test.
Definition branch.cpp:903
Test::Branch::IntTestSpace
Space for executing integer tests.
Definition branch.cpp:66
Test::Branch::IntTestSpace::bool_merit
double bool_merit(const Gecode::Space &, Gecode::BoolVar x, int)
Test function for branch merit function.
Definition branch.cpp:217
Test::Branch::IntTestSpace::IntTestSpace
IntTestSpace(int n, Gecode::IntSet &d)
Initialize test space.
Definition branch.cpp:75
Test::Branch::IntTestSpace::n_bool_var_branch
const int n_bool_var_branch
Number of integer variable selections.
Definition branch.cpp:210
Test::Branch::IntTestSpace::copy
virtual Gecode::Space * copy(void)
Copy space during cloning.
Definition branch.cpp:85
Test::Branch::IntTestSpace::n_int_var_branch
const int n_int_var_branch
Number of integer variable selections.
Definition branch.cpp:191
Test::Branch::IntTestSpace::varb
Gecode::IntVarBranch varb
Definition branch.cpp:71
Test::Branch::IntTestSpace::val
Gecode::IntValBranch val
Varlue selection criterion.
Definition branch.cpp:73
Test::Branch::IntTestSpace::bool_var_branch_name
const char * bool_var_branch_name[]
Names for Boolean variable selections.
Definition branch.cpp:194
Test::Branch::IntTestSpace::n_bool_val_branch
const int n_bool_val_branch
Number of Boolean value selections.
Definition branch.cpp:245
Test::Branch::IntTestSpace::IntTestSpace
IntTestSpace(IntTestSpace &s)
Constructor for cloning s.
Definition branch.cpp:80
Test::Branch::IntTestSpace::vara
Gecode::IntVarBranch vara
Variable selection criteria.
Definition branch.cpp:71
Test::Branch::IntTestSpace::int_var_branch_name
const char * int_var_branch_name[]
Names for integer variable selections.
Definition branch.cpp:157
Test::Branch::IntTestSpace::int_val
int int_val(const Gecode::Space &, Gecode::IntVar x, int)
Test function for branch value function.
Definition branch.cpp:248
Test::Branch::IntTestSpace::bool_val_branch_name
const char * bool_val_branch_name[]
Names for Boolean value selections.
Definition branch.cpp:238
Test::Branch::IntTestSpace::n_int_val_branch
const int n_int_val_branch
Number of integer value selections.
Definition branch.cpp:235
Test::Branch::IntTestSpace::x
Gecode::IntVarArray x
Variables to be tested.
Definition branch.cpp:69
Test::Branch::IntTestSpace::int_merit
double int_merit(const Gecode::Space &, Gecode::IntVar x, int)
Test function for branch merit function.
Definition branch.cpp:213
Test::Branch::IntTestSpace::bool_val
int bool_val(const Gecode::Space &, Gecode::BoolVar x, int)
Test function for branch value function.
Definition branch.cpp:252
Test::Branch::IntTestSpace::int_val_branch_name
const char * int_val_branch_name[]
Names for integer value selections.
Definition branch.cpp:221
Test::Branch::IntTest::IntTest
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition branch.cpp:430
Test::Branch::IntTest::arity
int arity
Number of variables.
Definition branch.hh:69
Test::Branch::IntTest::run
virtual bool run(void)
Perform test.
Definition branch.cpp:435
Test::Branch::IntTest::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post propagators on variables x.
Test::Branch::IntTest::dom
Gecode::IntSet dom
Domain of variables.
Definition branch.hh:71
Test::Branch::RunInfo
Information about one test-run.
Definition branch.cpp:386
Test::Branch::RunInfo::print
void print(std::ostream &o) const
Definition branch.cpp:394
Test::Branch::RunInfo::c_d
unsigned int c_d
Definition branch.cpp:389
Test::Branch::RunInfo::var
std::string var
Definition branch.cpp:388
Test::Branch::RunInfo::a_d
unsigned int a_d
Definition branch.cpp:389
Test::Branch::RunInfo::val
std::string val
Definition branch.cpp:388
Test::Branch::RunInfo::RunInfo
RunInfo(const std::string &vara, const std::string &varb, const std::string &valname, const Gecode::Search::Options &o)
Definition branch.cpp:390
Test::Branch::SetTestSpace
Space for executing Set tests.
Definition branch.cpp:111
Test::Branch::SetTestSpace::n_set_var_branch
const int n_set_var_branch
Number of set variable selections.
Definition branch.cpp:294
Test::Branch::SetTestSpace::set_var_branch_name
const char * set_var_branch_name[]
Names for set variable selections.
Definition branch.cpp:264
Test::Branch::SetTestSpace::set_merit
double set_merit(const Gecode::Space &, Gecode::SetVar, int)
Test function for branch merit function.
Definition branch.cpp:297
Test::Branch::SetTestSpace::n_set_val_branch
const int n_set_val_branch
Number of set value selections.
Definition branch.cpp:313
Test::Branch::SetTestSpace::x
Gecode::SetVarArray x
Variables to be tested.
Definition branch.cpp:114
Test::Branch::SetTestSpace::set_val_branch_name
const char * set_val_branch_name[]
Names for set value selections.
Definition branch.cpp:301
Test::Branch::SetTestSpace::set_val
int set_val(const Gecode::Space &, Gecode::SetVar x, int)
Test function for branch value function.
Definition branch.cpp:316
Test::Branch::SetTestSpace::copy
virtual Gecode::Space * copy(void)
Copy space during cloning.
Definition branch.cpp:124
Test::Branch::SetTestSpace::SetTestSpace
SetTestSpace(SetTestSpace &s)
Constructor for cloning s.
Definition branch.cpp:119
Test::Branch::SetTestSpace::SetTestSpace
SetTestSpace(int n, Gecode::IntSet &d)
Initialize test space.
Definition branch.cpp:116
Test::Branch::SetTest::post
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x)=0
Post propagators on variables x.
Test::Branch::SetTest::arity
int arity
Number of variables.
Definition branch.hh:106
Test::Branch::SetTest::SetTest
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition branch.cpp:735
Test::Branch::SetTest::run
virtual bool run(void)
Perform test.
Definition branch.cpp:740
Test::Branch::SetTest::dom
Gecode::IntSet dom
Domain of variables.
Definition branch.hh:108
float.hh
int.hh
set.hh
Gecode::branch
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Branch over x with variable selection vars and value selection vals.
Definition branch.cpp:39
Gecode::Space::Space
Space(void)
Default constructor.
Definition core.cpp:115
Gecode::bab
T * bab(T *s, const Search::Options &o=Search::Options::def)
Perform depth-first branch-and-bound search for subclass T of space s and options o.
Definition bab.hpp:77
Gecode::Space::status
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
Definition core.cpp:252
Gecode::Space::clone
Space * clone(CloneStatistics &stat=unused_clone) const
Clone space.
Definition core.hpp:3224
kernel.hh
Gecode
Gecode toplevel namespace
Gecode::FLOAT_VAR_DEGREE_SIZE_MAX
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree divided by domain size.
Definition var.hpp:222
Gecode::SET_VAR_MERIT_MAX
SetVarBranch SET_VAR_MERIT_MAX(SetBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:111
Gecode::FLOAT_VAR_DEGREE_SIZE_MIN
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree divided by domain size.
Definition var.hpp:217
Gecode::SET_VAL_MED_INC
SetValBranch SET_VAL_MED_INC(void)
Include median element (rounding downwards).
Definition val.hpp:65
Gecode::FLOAT_VAR_RND
FloatVarBranch FLOAT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
Definition var.hpp:112
Gecode::FLOAT_VAL_SPLIT_MAX
FloatValBranch FLOAT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition val.hpp:60
Gecode::BOOL_VAR_CHB_MIN
BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:434
Gecode::SET_VAR_ACTION_SIZE_MIN
SetVarBranch SET_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest action divided by domain size with decay factor d.
Definition var.hpp:246
Gecode::SET_VAR_CHB_SIZE_MIN
SetVarBranch SET_VAR_CHB_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest CHB Q-score divided by domain size.
Definition var.hpp:266
Gecode::SET_VAR_ACTION_SIZE_MAX
SetVarBranch SET_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest action divided by domain size with decay factor d.
Definition var.hpp:256
Gecode::INT_VAL_SPLIT_MIN
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition val.hpp:75
Gecode::FLOAT_VAR_AFC_MIN
FloatVarBranch FLOAT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:127
Gecode::INT_VAL_RANGE_MIN
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition val.hpp:85
Gecode::INT_VAL_RANGE_MAX
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition val.hpp:90
Gecode::BOOL_VAL
BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition val.hpp:145
Gecode::FLOAT_VAR_SIZE_MAX
FloatVarBranch FLOAT_VAR_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest domain size.
Definition var.hpp:212
Gecode::INT_VALUES_MAX
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition val.hpp:105
Gecode::INT_VAR_AFC_SIZE_MAX
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:236
Gecode::INT_VAR_CHB_SIZE_MIN
IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl=nullptr)
Select variable with smallest CHB Q-score divided by domain size.
Definition var.hpp:266
Gecode::FLOAT_VAR_MAX_MAX
FloatVarBranch FLOAT_VAR_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest max.
Definition var.hpp:202
Gecode::SET_VAR_NONE
SetVarBranch SET_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:96
Gecode::INT_VAR_DEGREE_MAX
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:121
Gecode::SET_VAL_RND_INC
SetValBranch SET_VAL_RND_INC(Rnd r)
Include random element.
Definition val.hpp:85
Gecode::FLOAT_VAL_SPLIT_RND
FloatValBranch FLOAT_VAL_SPLIT_RND(Rnd r)
Select values randomly which are not greater or not smaller than mean of largest and smallest value.
Definition val.hpp:65
Gecode::INT_VAR_REGRET_MIN_MIN
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest min-regret.
Definition var.hpp:286
Gecode::INT_VAR_ACTION_MAX
IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:156
Gecode::SET_VAR_DEGREE_SIZE_MAX
SetVarBranch SET_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree divided by domain size.
Definition var.hpp:221
Gecode::FLOAT_VAR_AFC_SIZE_MIN
FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smalllest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:227
Gecode::FLOAT_VAR_CHB_SIZE_MAX
FloatVarBranch FLOAT_VAR_CHB_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score divided by domain size.
Definition var.hpp:277
Gecode::INT_VAL_MED
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition val.hpp:60
Gecode::INT_VAL
IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition val.hpp:95
Gecode::tiebreak
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
Definition tiebreak.hpp:80
Gecode::INT_VAR_REGRET_MIN_MAX
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest min-regret.
Definition var.hpp:291
Gecode::SET_VAL_RND_EXC
SetValBranch SET_VAL_RND_EXC(Rnd r)
Exclude random element.
Definition val.hpp:90
Gecode::INT_VAR_ACTION_SIZE_MAX
IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest action divided by domain size with decay factor d.
Definition var.hpp:256
Gecode::SET_VAR_CHB_MIN
SetVarBranch SET_VAR_CHB_MIN(BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:166
Gecode::BOOL_VAL_MIN
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition val.hpp:130
Gecode::BOOL_VAR_MERIT_MIN
BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:374
Gecode::SET_VAR_MIN_MAX
SetVarBranch SET_VAR_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest minimum unknown element.
Definition var.hpp:191
Gecode::SET_VAR_CHB_MAX
SetVarBranch SET_VAR_CHB_MAX(BranchTbl tbl=nullptr)
Select variable with highest CHB Q-score.
Definition var.hpp:176
Gecode::INT_VAR_NONE
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:96
Gecode::INT_VAR_CHB_MIN
IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:166
Gecode::BOOL_VAR_NONE
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:364
Gecode::INT_VAR_AFC_MAX
IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:136
Gecode::INT_VAR_AFC_MIN
IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:126
Gecode::INT_VAR_REGRET_MAX_MAX
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest max-regret.
Definition var.hpp:301
Gecode::SET_VAL
SetValBranch SET_VAL(SetBranchVal v, SetBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c.
Definition val.hpp:95
Gecode::INT_VALUES_MIN
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition val.hpp:100
Gecode::SET_VAR_SIZE_MIN
SetVarBranch SET_VAR_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest unknown set.
Definition var.hpp:206
Gecode::SET_VAR_RND
SetVarBranch SET_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
Definition var.hpp:101
Gecode::FLOAT_VAR_CHB_MIN
FloatVarBranch FLOAT_VAR_CHB_MIN(BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:167
Gecode::SET_VAR_MAX_MAX
SetVarBranch SET_VAR_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest maximum unknown element.
Definition var.hpp:201
Gecode::INT_VAR_CHB_MAX
IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score.
Definition var.hpp:176
Gecode::FLOAT_VAR_CHB_SIZE_MIN
FloatVarBranch FLOAT_VAR_CHB_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest CHB Q-score divided by domain size.
Definition var.hpp:267
Gecode::INT_VAL_MAX
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition val.hpp:65
Gecode::FLOAT_VAR_ACTION_MAX
FloatVarBranch FLOAT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:157
Gecode::BOOL_VAL_MAX
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition val.hpp:135
Gecode::BOOL_VAR_RND
BoolVarBranch BOOL_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
Definition var.hpp:369
Gecode::BOOL_VAR_ACTION_MIN
BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:414
Gecode::FLOAT_VAR_CHB_MAX
FloatVarBranch FLOAT_VAR_CHB_MAX(BranchTbl tbl=nullptr)
Select variable with highest CHB Q-score.
Definition var.hpp:177
Gecode::SET_VAR_AFC_MAX
SetVarBranch SET_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:136
Gecode::FLOAT_VAR_MIN_MIN
FloatVarBranch FLOAT_VAR_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest min.
Definition var.hpp:187
Gecode::BOOL_VAR_DEGREE_MIN
BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:384
Gecode::FLOAT_VAL
FloatValBranch FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c=nullptr)
Definition val.hpp:70
Gecode::SET_VAR_MIN_MIN
SetVarBranch SET_VAR_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest minimum unknown element.
Definition var.hpp:186
Gecode::FLOAT_VAR_MAX_MIN
FloatVarBranch FLOAT_VAR_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest max.
Definition var.hpp:197
Gecode::FLOAT_VAR_ACTION_MIN
FloatVarBranch FLOAT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:147
Gecode::SET_VAL_MED_EXC
SetValBranch SET_VAL_MED_EXC(void)
Exclude median element (rounding downwards).
Definition val.hpp:70
Gecode::SET_VAL_MAX_INC
SetValBranch SET_VAL_MAX_INC(void)
Include largest element.
Definition val.hpp:75
Gecode::INT_VAL_SPLIT_MAX
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition val.hpp:80
Gecode::INT_VAR_MAX_MIN
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest max.
Definition var.hpp:196
Gecode::INT_VAL_MIN
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition val.hpp:55
Gecode::SET_VAR_CHB_SIZE_MAX
SetVarBranch SET_VAR_CHB_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score divided by domain size.
Definition var.hpp:276
Gecode::SET_VAR_DEGREE_MIN
SetVarBranch SET_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:116
Gecode::SET_VAR_AFC_MIN
SetVarBranch SET_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:126
Gecode::BOOL_VAR_AFC_MIN
BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:394
Gecode::BOOL_VAR_AFC_MAX
BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:404
Gecode::BOOL_VAR_CHB_MAX
BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score.
Definition var.hpp:444
Gecode::SET_VAR_MAX_MIN
SetVarBranch SET_VAR_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest maximum unknown element.
Definition var.hpp:196
Gecode::FLOAT_VAR_NONE
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:97
Gecode::INT_VAR_MAX_MAX
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest max.
Definition var.hpp:201
Gecode::SET_VAR_DEGREE_MAX
SetVarBranch SET_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:121
Gecode::INT_VAR_ACTION_MIN
IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:146
Gecode::INT_VAR_RND
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking).
Definition var.hpp:101
Gecode::INT_VAR_AFC_SIZE_MIN
IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:226
Gecode::SET_VAL_MIN_INC
SetValBranch SET_VAL_MIN_INC(void)
Include smallest element.
Definition val.hpp:55
Gecode::FLOAT_VAR_DEGREE_MAX
FloatVarBranch FLOAT_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:122
Gecode::INT_VAR_DEGREE_MIN
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:116
Gecode::SET_VAR_AFC_SIZE_MIN
SetVarBranch SET_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:226
Gecode::SET_VAL_MAX_EXC
SetValBranch SET_VAL_MAX_EXC(void)
Exclude largest element.
Definition val.hpp:80
Gecode::FLOAT_VAR_ACTION_SIZE_MAX
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest action divided by domain size with decay factor d.
Definition var.hpp:257
Gecode::BOOL_VAL_RND
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition val.hpp:140
Gecode::INT_VAR_REGRET_MAX_MIN
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest max-regret.
Definition var.hpp:296
Gecode::INT_VAR_MERIT_MIN
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:106
Gecode::INT_VAR_CHB_SIZE_MAX
IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score divided by domain size.
Definition var.hpp:276
Gecode::FLOAT_VAR_MIN_MAX
FloatVarBranch FLOAT_VAR_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest min.
Definition var.hpp:192
Gecode::SET_VAR_AFC_SIZE_MAX
SetVarBranch SET_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:236
Gecode::INT_VAR_DEGREE_SIZE_MAX
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree divided by domain size.
Definition var.hpp:221
Gecode::SET_VAR_ACTION_MIN
SetVarBranch SET_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:146
Gecode::INT_VAR_MERIT_MAX
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:111
Gecode::INT_VAR_SIZE_MIN
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest domain size.
Definition var.hpp:206
Gecode::BOOL_VAR_DEGREE_MAX
BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:389
Gecode::SET_VAR_MERIT_MIN
SetVarBranch SET_VAR_MERIT_MIN(SetBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:106
Gecode::FLOAT_VAR_AFC_SIZE_MAX
FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:237
Gecode::FLOAT_VAR_MERIT_MIN
FloatVarBranch FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:102
Gecode::INT_VAR_ACTION_SIZE_MIN
IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest action divided by domain size with decay factor d.
Definition var.hpp:246
Gecode::FLOAT_VAR_DEGREE_MIN
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:117
Gecode::BOOL_VAR_ACTION_MAX
BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:424
Gecode::FLOAT_VAL_SPLIT_MIN
FloatValBranch FLOAT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition val.hpp:55
Gecode::SET_VAR_DEGREE_SIZE_MIN
SetVarBranch SET_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree divided by domain size.
Definition var.hpp:216
Gecode::FLOAT_VAR_SIZE_MIN
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest domain size.
Definition var.hpp:207
Gecode::INT_VAR_MIN_MAX
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest min.
Definition var.hpp:191
Gecode::BOOL_VAR_MERIT_MAX
BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:379
Gecode::INT_VAR_DEGREE_SIZE_MIN
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree divided by domain size.
Definition var.hpp:216
Gecode::INT_VAR_MIN_MIN
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest min.
Definition var.hpp:186
Gecode::FLOAT_VAR_AFC_MAX
FloatVarBranch FLOAT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:137
Gecode::SET_VAL_MIN_EXC
SetValBranch SET_VAL_MIN_EXC(void)
Exclude smallest element.
Definition val.hpp:60
Gecode::INT_VAR_SIZE_MAX
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest domain size.
Definition var.hpp:211
Gecode::SET_VAR_SIZE_MAX
SetVarBranch SET_VAR_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest unknown set.
Definition var.hpp:211
Gecode::INT_VAL_RND
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition val.hpp:70
Gecode::SET_VAR_ACTION_MAX
SetVarBranch SET_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:156
Gecode::FLOAT_VAR_ACTION_SIZE_MIN
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest action divided by domain size with decay factor d.
Definition var.hpp:247
Gecode::FLOAT_VAR_MERIT_MAX
FloatVarBranch FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:107
Test::Branch
Tests for branchings.
Definition branch.cpp:58
Test::Branch::tbl
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition branch.cpp:61
Test::Branch::solutions
int solutions(TestSpace *c, Gecode::Search::Options &o, int maxNbSol=-1)
Find number of solutions.
Definition branch.cpp:412
Test
General test support.
Definition afc.cpp:39
Test::r
Region r
Definition region.cpp:65
search.hh
operator<<
std::ostream & operator<<(std::ostream &os, const Test::Branch::RunInfo &ri)
Definition branch.cpp:402
branch.hh