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

Method inspectCurrentNode

gecode/gist/treecanvas.cpp:627–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625 }
626
627 void
628 TreeCanvas::inspectCurrentNode(bool fix, int inspectorNo) {
629 QMutexLocker locker(&mutex);
630
631 if (currentNode->isHidden()) {
632 toggleHidden();
633 return;
634 }
635
636 int failedInspectorType = -1;
637 int failedInspector = -1;
638 bool needCentering = false;
639 try {
640 switch (currentNode->getStatus()) {
641 case UNDETERMINED:
642 {
643 unsigned int kids =
644 currentNode->getNumberOfChildNodes(*na,curBest,stats,c_d,a_d);
645 int depth = -1;
646 for (VisualNode* p = currentNode; p != nullptr; p=p->getParent(*na))
647 depth++;
648 if (kids > 0) {
649 needCentering = true;
650 depth++;
651 }
652 stats.maxDepth =
653 std::max(stats.maxDepth, depth);
654 if (currentNode->getStatus() == SOLVED) {
655 assert(currentNode->hasCopy());
656 emit solution(currentNode->getWorkingSpace());
657 }
658 emit statusChanged(currentNode,stats,true);
659 for (int i=0; i<moveInspectors.size(); i++) {
660 if (moveInspectors[i].second) {
661 failedInspectorType = 0;
662 failedInspector = i;
663 if (currentNode->getStatus() == FAILED) {
664 if (!currentNode->isRoot()) {
665 Space* curSpace =
666 currentNode->getSpace(*na,curBest,c_d,a_d);
667 moveInspectors[i].first->inspect(*curSpace);
668 delete curSpace;
669 }
670 } else {
671 moveInspectors[i].first->
672 inspect(*currentNode->getWorkingSpace());
673 }
674 failedInspectorType = -1;
675 }
676 }
677 if (currentNode->getStatus() == SOLVED) {
678 currentNode->purge(*na);
679 }
680 }
681 break;
682 case FAILED:
683 case STOP:
684 case UNSTOP:

Callers 2

inspectWithActionMethod · 0.80

Calls 15

updateFunction · 0.85
isHiddenMethod · 0.80
getStatusMethod · 0.80
getNumberOfChildNodesMethod · 0.80
getParentMethod · 0.80
hasCopyMethod · 0.80
getWorkingSpaceMethod · 0.80
isRootMethod · 0.80
getChoiceMethod · 0.80
getAlternativeMethod · 0.80
dirtyUpMethod · 0.80
dfsFunction · 0.70

Tested by

no test coverage detected