MCPcopy Create free account
hub / github.com/Gecode/gecode / solution

Method solution

gecode/search/par/bab.hpp:116–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 }
115 template<class Tracer>
116 forceinline void
117 BAB<Tracer>::solution(Space* s) {
118 m_search.acquire();
119 if (best != nullptr) {
120 s->constrain(*best);
121 if (s->status() == SS_FAILED) {
122 delete s;
123 m_search.release();
124 return;
125 } else {
126 delete best;
127 best = s->clone();
128 }
129 } else {
130 best = s->clone();
131 }
132 // Announce better solutions
133 for (unsigned int i=0U; i<workers(); i++)
134 worker(i)->better(best);
135 bool bs = signal();
136 solutions.push(s);
137 if (bs)
138 e_search.signal();
139 m_search.release();
140 }
141
142
143 /*

Callers 1

runMethod · 0.45

Calls 8

betterMethod · 0.80
acquireMethod · 0.45
constrainMethod · 0.45
statusMethod · 0.45
releaseMethod · 0.45
cloneMethod · 0.45
pushMethod · 0.45
signalMethod · 0.45

Tested by

no test coverage detected