70 std::vector<AResult>& results)
74 results.emplace_back(path);
79 const AState* currentState = path.back();
81 TrackFindingCDC::asRange(std::equal_range(relations.begin(), relations.end(), currentState));
83 std::vector<TrackFindingCDC::WithWeight<AState*>> childStates;
85 AState* childState = continuation.getTo();
86 TrackFindingCDC::Weight weight = continuation.getWeight();
89 if (std::count(path.begin(), path.end(), childState)) {
92 B2FATAL(
"Cycle detected!");
96 childStates.emplace_back(childState, weight);
99 if (childStates.empty()) {
100 B2DEBUG(29,
"Terminating this route, as there are no possible child states.");
102 results.emplace_back(path);
109 const std::vector<TrackFindingCDC::WithWeight<const AState*>>& constPath = path;
112 if (childStates.empty()) {
113 B2DEBUG(29,
"Terminating this route, as there are no possible child states.");
115 results.emplace_back(path);
121 const auto stateLess = [](
const auto & lhs,
const auto & rhs) {
122 return lhs->getAutomatonCell().getCellState() < rhs->getAutomatonCell().getCellState();
124 std::sort(childStates.begin(), childStates.end(), stateLess);
126 B2DEBUG(29,
"Having found " << childStates.size() <<
" child states.");
128 path.emplace_back(childState, childState.getWeight());