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

Method inspectSolution

gecode/gist/treecanvas.cpp:785–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783 }
784
785 void
786 TreeCanvas::inspectSolution(const Space* s) {
787 int failedInspectorType = -1;
788 int failedInspector = -1;
789 try {
790 Space* c = nullptr;
791 for (int i=0; i<solutionInspectors.size(); i++) {
792 if (solutionInspectors[i].second) {
793 if (c == nullptr)
794 c = s->clone();
795 failedInspectorType = 1;
796 failedInspector = i;
797 solutionInspectors[i].first->inspect(*c);
798 failedInspectorType = -1;
799 }
800 }
801 delete c;
802 } catch (Exception& e) {
803 switch (failedInspectorType) {
804 case 0:
805 qFatal("Exception in move inspector %d: %s.\n Stopping.",
806 failedInspector, e.what());
807 break;
808 case 1:
809 qFatal("Exception in solution inspector %d: %s.\n Stopping.",
810 failedInspector, e.what());
811 break;
812 default:
813 qFatal("Exception: %s.\n Stopping.", e.what());
814 break;
815 }
816 }
817 }
818
819 void
820 TreeCanvas::stopSearch(void) {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
cloneMethod · 0.45
inspectMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected