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

Method node

gecode/search/cpprofiler/tracer.cpp:98–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 void
99 CPProfilerSearchTracer::node(const EdgeInfo& ei, const NodeInfo& ni) {
100 CPProfiler::NodeUID this_node{static_cast<int>(ni.nid()),
101 restart,
102 static_cast<int>(ni.wid())};
103 CPProfiler::NodeUID parent {-1,restart,-1};
104
105 int alt = 0;
106 int alts = 0;
107
108 CPProfiler::NodeStatus ns = CPProfiler::NodeStatus::FAILED;
109 switch(ni.type()) {
110 case NodeType::SOLVED:
111 ns = CPProfiler::NodeStatus::SOLVED;
112 break;
113 case NodeType::BRANCH:
114 ns = CPProfiler::NodeStatus::BRANCH;
115 alts = static_cast<int>(ni.choice().alternatives());
116 break;
117 case NodeType::FAILED:
118 ns = CPProfiler::NodeStatus::FAILED;
119 break;
120 default:
121 GECODE_NEVER;
122 }
123
124 std::string label;
125 if(ei) {
126 parent = {static_cast<int>(ei.nid()),
127 restart,
128 static_cast<int>(ei.wid())};
129
130 alt = static_cast<int>(ei.alternative());
131 label = ei.string();
132 } else {
133 alt = restart;
134 }
135
136 std::string info;
137 if(pgi) {
138 info = pgi->getInfo(ni.space());
139 }
140
141 auto node = connector->createNode(this_node, parent, alt, alts, ns)
142 .set_label(label)
143 .set_info(info);
144 connector->sendNode(node);
145 }
146
147 void
148 CPProfilerSearchTracer::done(void) {

Callers 5

nextMethod · 0.45
nextMethod · 0.45
nextMethod · 0.45
runMethod · 0.45
runMethod · 0.45

Calls 13

alternativesMethod · 0.80
stringMethod · 0.80
set_infoMethod · 0.80
set_labelMethod · 0.80
createNodeMethod · 0.80
sendNodeMethod · 0.80
nidMethod · 0.45
widMethod · 0.45
typeMethod · 0.45
choiceMethod · 0.45
alternativeMethod · 0.45
getInfoMethod · 0.45

Tested by

no test coverage detected