47 unsigned int fst,
unsigned int lst)
48 : _type(et), _fst(fst), _lst(lst) {}
76 return wlst() - wfst();
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) {
229 es[n_e]=EngineInfo(
t,n_e+1,n_e+1+
n);
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 {
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Choice for performing commit
void invalidate(void)
Invalidate edge information (for stealing)
unsigned int alternative(void) const
Return number of alternative.
void init(unsigned int wid, unsigned int nid, unsigned int a)
Initialize.
unsigned int wid(void) const
Return parent worker id.
std::string string(void) const
Return string for alternative.
unsigned int nid(void) const
Return parent node id.
EdgeInfo(void)
Initialize as non existing.
Information about an engine.
bool meta(void) const
Return whether engine is a meta engine.
unsigned int wfst(void) const
Return id of first worker.
EngineInfo(void)
Do not initialize.
unsigned int workers(void) const
Return number of workers.
EngineType type(void) const
Return engine type.
unsigned int efst(void) const
Return id of first engine.
unsigned int engines(void) const
Return number of engines.
unsigned int elst(void) const
Return id of last engine.
unsigned int wlst(void) const
Return id of last worker plus one.
NodeType type(void) const
Return node type.
const Choice & choice(void) const
Return corresponding choice.
unsigned int nid(void) const
Return node id.
unsigned int wid(void) const
Return worker id.
const Space & space(void) const
Return corresponding space.
NodeInfo(NodeType nt, unsigned int wid, unsigned int nid, const Space &s, const Choice *c=nullptr)
Initialize node info.
unsigned int eid(unsigned int wid) const
Return the engine id of a worker with id wid.
virtual void init(void)=0
The search engine initializes.
EngineType
Which type of engine.
@ BAB
Engine is a BAB engine.
@ DFS
Engine is a DFS engine.
@ AOE
Unspecified engine (any other engine)
@ PBS
Engine is a PBS engine.
@ RBS
Engine is a RBS engine.
@ LDS
Engine is a LDS engine.
unsigned int engines(void) const
Return number of engines.
virtual ~SearchTracer(void)
Delete.
virtual void node(const EdgeInfo &ei, const NodeInfo &ni)=0
The engine creates a new node with information ei and ni.
virtual void round(unsigned int eid)=0
The engine with id eid goes to a next round (restart or next iteration in LDS)
unsigned int workers(void) const
Return number of workers.
virtual void skip(const EdgeInfo &ei)=0
The engine skips an edge.
SearchTracer(void)
Initialize.
virtual void done(void)=0
All workers are done.
A lock as a scoped frontend for a mutex.
Heap heap
The single global heap.
void print(const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
Gecode toplevel namespace
#define GECODE_NEVER
Assert that this command is never executed.