Go to the documentation of this file.
47 unsigned int fst,
unsigned int lst)
48 : _type(et), _fst(fst), _lst(lst) {}
57 return (type() == EngineType::RBS) || (type() == EngineType::PBS);
62 assert((type() == EngineType::DFS) || (type() == EngineType::BAB) ||
63 (type() == EngineType::LDS) || (type() == EngineType::AOE));
69 assert((type() == EngineType::DFS) || (type() == EngineType::BAB) ||
70 (type() == EngineType::LDS) || (type() == EngineType::AOE));
76 return wlst() - wfst();
81 assert((type() == EngineType::RBS) || (type() == EngineType::PBS));
87 assert((type() == EngineType::RBS) || (type() == EngineType::PBS));
93 return elst() - efst();
103 _wid=UINT_MAX; _s.clear();
109 _wid=wid; _nid=nid;
_a=
a; _s=
"";
116 _wid=wid; _nid=nid;
_a=
a;
117 std::ostringstream os;
118 s.
print(
c,
a, os); _s = os.str();
124 : _wid(wid), _nid(nid),
_a(
a) {}
131 SearchTracer::EdgeInfo::operator bool(
void)
const {
132 return _wid != UINT_MAX;
166 unsigned int wid,
unsigned int nid,
168 : _nt(nt), _wid(wid), _nid(nid), _s(s),
_c(
c) {}
202 SearchTracer::_round(
unsigned int eid) {
208 SearchTracer::_skip(
const EdgeInfo& ei) {
214 SearchTracer::_node(
const EdgeInfo& ei,
const NodeInfo& ni) {
221 : pending(1U), n_e(0U), n_w(0U), es(
heap), w2e(
heap) {}
224 SearchTracer::engine(EngineType
t,
unsigned int n) {
228 case EngineType::PBS:
case EngineType::RBS:
229 es[n_e]=EngineInfo(
t,n_e+1,n_e+1+
n);
231 case EngineType::DFS:
case EngineType::BAB:
232 case EngineType::LDS:
case EngineType::AOE:
233 es[n_e]=EngineInfo(
t,n_w,n_w+
n);
242 SearchTracer::worker(
unsigned int& wid,
unsigned int& eid) {
254 SearchTracer::worker(
void) {
256 if (--n_active == 0U)
271 SearchTracer::engine(
unsigned int eid)
const {
SearchTracer(void)
Initialize.
unsigned int wlst(void) const
Return id of last worker plus one.
NodeType type(void) const
Return node type.
unsigned int nid(void) const
Return parent node id.
virtual void round(unsigned int eid)=0
The engine with id eid goes to a next round (restart or next iteration in LDS)
virtual void init(void)=0
The search engine initializes.
Multi _c(Gecode::IntArgs({1, 2, 3}))
void invalidate(void)
Invalidate edge information (for stealing)
const Space & space(void) const
Return corresponding space.
virtual void done(void)=0
All workers are done.
A lock as a scoped frontend for a mutex.
NodeInfo(NodeType nt, unsigned int wid, unsigned int nid, const Space &s, const Choice *c=nullptr)
Initialize node info.
EngineType type(void) const
Return engine type.
unsigned int engines(void) const
Return number of engines.
unsigned int workers(void) const
Return number of workers.
unsigned int alternative(void) const
Return number of alternative.
unsigned int wid(void) const
Return worker id.
Gecode toplevel namespace
const Choice & choice(void) const
Return corresponding choice.
EdgeInfo(void)
Initialize as non existing.
std::string string(void) const
Return string for alternative.
unsigned int efst(void) const
Return id of first engine.
unsigned int wid(void) const
Return parent worker id.
@ BRANCH
Node representing a branch.
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Heap heap
The single global heap.
virtual void node(const EdgeInfo &ei, const NodeInfo &ni)=0
The engine creates a new node with information ei and ni.
void init(unsigned int wid, unsigned int nid, unsigned int a)
Initialize.
unsigned int eid(unsigned int wid) const
Return the engine id of a worker with id wid.
unsigned int nid(void) const
Return node id.
unsigned int elst(void) const
Return id of last engine.
virtual void skip(const EdgeInfo &ei)=0
The engine skips an edge.
EngineInfo(void)
Do not initialize.
void print(const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
Gecode::FloatVal c(-8, 8)
Information about an engine.
int n
Number of negative literals for node type.
Choice for performing commit
unsigned int workers(void) const
Return number of workers.
EngineType
Which type of engine.
unsigned int engines(void) const
Return number of engines.
bool meta(void) const
Return whether engine is a meta engine.
virtual ~SearchTracer(void)
Delete.
unsigned int wfst(void) const
Return id of first worker.