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

Method labelPath

gecode/gist/visualnode.cpp:174–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172 }
173
174 void
175 VisualNode::labelPath(NodeAllocator& na,
176 BestNode* curBest, int c_d, int a_d) {
177 if (na.hasLabel(this)) {
178 // clear labels on path to root
179 VisualNode* p = this;
180 while (p) {
181 na.clearLabel(p);
182 p = p->getParent(na);
183 }
184 } else {
185 // set labels on path to root
186 std::vector<std::pair<VisualNode*,int> > path;
187 VisualNode* p = this;
188 while (p) {
189 path.push_back(std::pair<VisualNode*,int>(p,p->getAlternative(na)));
190 p = p->getParent(na);
191 }
192 while (!path.empty()) {
193 std::pair<VisualNode*,int> cur = path.back(); path.pop_back();
194 if (p) {
195 std::string l =
196 cur.first->getBranchLabel(na,p,p->getChoice(),
197 curBest,c_d,a_d,cur.second);
198 na.setLabel(cur.first,QString(l.c_str()));
199 }
200 p = cur.first;
201 }
202 }
203 dirtyUp(na);
204 }
205
206 void
207 VisualNode::unhideAll(const NodeAllocator& na) {

Callers

nothing calls this directly

Calls 8

hasLabelMethod · 0.80
clearLabelMethod · 0.80
getParentMethod · 0.80
getAlternativeMethod · 0.80
getBranchLabelMethod · 0.80
getChoiceMethod · 0.80
setLabelMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected