29 #ifndef INCLUDE_YEN_PGR_TURNRESTRICTEDPATH_HPP_
30 #define INCLUDE_YEN_PGR_TURNRESTRICTEDPATH_HPP_
51 template <
typename G >
53 typedef std::set<Path, compPathsLess>
pSet;
62 std::vector<trsp::Rule> &restrictions,
70 if (path.
empty())
return;
79 if (path.
empty())
return;
108 const std::vector<pgrouting::trsp::Rule> &restrictions,
124 return Yen(graph, source, target, k);
136 int64_t start_vertex,
142 if (start_vertex == end_vertex) {
143 return std::deque<Path>();
149 if (!graph.has_vertex(start_vertex)
150 || !graph.has_vertex(end_vertex)) {
151 return std::deque<Path>();
159 this->
v_source = graph.get_V(start_vertex);
160 this->
v_target = graph.get_V(end_vertex);
162 this->
m_end = end_vertex;
179 }
catch (boost::exception
const& ex) {
182 }
catch (std::exception &e) {
202 std::deque<Path> &paths) {
203 if (paths.empty())
return paths;
204 if (
m_strict)
return std::deque<Path>();
208 std::stable_sort(paths.begin(), paths.end(),
209 [](
const Path &left,
const Path &right) ->
bool {
210 return (left.countInfinityCost() < right.countInfinityCost());
213 auto count = paths.begin()->countInfinityCost();
220 paths.begin(), paths.end(),
221 [&count](
const Path &p){
222 return count != p.countInfinityCost();
246 if (paths.empty())
return paths;
247 for (
auto &p : paths) {
249 p = p.inf_cost_on_restriction(r);
269 #endif // INCLUDE_YEN_PGR_TURNRESTRICTEDPATH_HPP_