51 unsigned int fst,
unsigned int lst)
61 return (
type() == EngineType::RBS) || (
type() == EngineType::PBS);
66 assert((
type() == EngineType::DFS) || (
type() == EngineType::BAB) ||
67 (
type() == EngineType::LDS) || (
type() == EngineType::AOE));
73 assert((
type() == EngineType::DFS) || (
type() == EngineType::BAB) ||
74 (
type() == EngineType::LDS) || (
type() == EngineType::AOE));
85 assert((
type() == EngineType::RBS) || (
type() == EngineType::PBS));
91 assert((
type() == EngineType::RBS) || (
type() == EngineType::PBS));
107 _wid=UINT_MAX; _s.clear();
113 _wid=wid; _nid=nid;
_a=
a; _s=
"";
120 _wid=wid; _nid=nid;
_a=
a;
121 std::ostringstream os;
122 s.
print(c, a, os); _s = os.str();
128 : _wid(wid), _nid(nid),
_a(a) {}
135 SearchTracer::EdgeInfo::operator bool(
void)
const {
136 return _wid != UINT_MAX;
170 unsigned int wid,
unsigned int nid,
206 SearchTracer::_round(
unsigned int eid) {
213 SearchTracer::_skip(
const EdgeInfo& ei) {
228 : pending(1U), n_e(0U), n_w(0U), es(
heap), w2e(
heap) {}
235 case EngineType::PBS:
case EngineType::RBS:
238 case EngineType::DFS:
case EngineType::BAB:
239 case EngineType::LDS:
case EngineType::AOE:
249 SearchTracer::worker(
unsigned int& wid,
unsigned int& eid) {
261 SearchTracer::worker(
void) {
263 if (--n_active == 0U) {
280 SearchTracer::engine(
unsigned int eid)
const {
unsigned int elst(void) const
Return id of last engine.
const Space & _s
The corresponding space.
const Choice * _c
The corresponding choice (nullptr if type is not BRANCH)
unsigned int nid(void) const
Return node id.
virtual void node(const EdgeInfo &ei, const NodeInfo &ni)=0
The engine creates a new node with information ei and ni.
unsigned int eid(unsigned int wid) const
Return the engine id of a worker with id wid.
EdgeInfo(void)
Initialize as non existing.
Node representing a branch.
EngineType type(void) const
Return engine type.
unsigned int engines(void) const
Return number of engines.
unsigned int _nid
The parent node id.
std::string _s
String corresponding to alternative.
bool meta(void) const
Return whether engine is a meta engine.
const Choice & choice(void) const
Return corresponding choice.
void acquire(void)
Acquire the mutex and possibly block.
unsigned int wid(void) const
Return parent worker id.
Multi _c(Gecode::IntArgs(3, 1, 2, 3))
unsigned int wlst(void) const
Return id of last worker plus one.
unsigned int engines(void) const
Return number of engines.
virtual void skip(const EdgeInfo &ei)=0
The engine skips an edge.
EngineType
Which type of engine.
std::string string(void) const
Return string for alternative.
void release(void)
Release the mutex.
Gecode::FloatVal c(-8, 8)
void print(const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
void init(unsigned int wid, unsigned int nid, unsigned int a)
Initialize.
int n
Number of negative literals for node type.
unsigned int efst(void) const
Return id of first engine.
EngineType _type
The engine type.
NodeType type(void) const
Return node type.
unsigned int _a
Number of alternative.
unsigned int nid(void) const
Return parent node id.
SearchTracer(void)
Initialize.
virtual void init(void)=0
The search engine initializes.
unsigned int _lst
Last worker or engine.
NodeInfo(NodeType nt, unsigned int wid, unsigned int nid, const Space &s, const Choice *c=nullptr)
Initialize node info.
EngineInfo(void)
Do not initialize.
virtual ~SearchTracer(void)
Delete.
virtual void round(unsigned int eid)=0
The engine with id eid goes to a next round (restart or next iteration in LDS)
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
Choice for performing commit
unsigned int alternative(void) const
Return number of alternative.
unsigned int workers(void) const
Return number of workers.
unsigned int workers(void) const
Return number of workers.
unsigned int wid(void) const
Return worker id.
Heap heap
The single global heap.
virtual void done(void)=0
All workers are done.
unsigned int _wid
The worker id.
unsigned int _nid
The node id.
unsigned int wfst(void) const
Return id of first worker.
Gecode toplevel namespace
Information about an engine.
void invalidate(void)
Invalidate edge information (for stealing)
unsigned int _wid
The parent worker id (edge does not exist if UINT_MAX)
NodeType _nt
The node type.
#define GECODE_NEVER
Assert that this command is never executed.
unsigned int _fst
First worker or engine.
const Space & space(void) const
Return corresponding space.