| 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) { |
no test coverage detected