47 unsigned int fst,
unsigned int lst)
103 _wid=UINT_MAX;
_s.clear();
117 std::ostringstream os;
118 s.
print(c, a, os);
_s = os.str();
131 SearchTracer::EdgeInfo::operator bool(
void)
const {
132 return _wid != UINT_MAX;
166 unsigned int wid,
unsigned int nid,
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 {
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 _a
Number of alternative.
unsigned int _nid
The parent node id.
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.
unsigned int _wid
The parent worker id (edge does not exist if UINT_MAX)
std::string _s
String corresponding to alternative.
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.
unsigned int _lst
Last worker or engine.
EngineInfo(void)
Do not initialize.
unsigned int workers(void) const
Return number of workers.
EngineType _type
The engine type.
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 _fst
First worker or engine.
unsigned int elst(void) const
Return id of last engine.
unsigned int wlst(void) const
Return id of last worker plus one.
unsigned int _wid
The worker id.
const Choice * _c
The corresponding choice (nullptr if type is not BRANCH)
NodeType _nt
The node type.
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.
unsigned int _nid
The node id.
const Space & _s
The 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.