Go to the documentation of this file.
2 #include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp>
3 #include <boost/graph/filtered_graph.hpp>
4 #include <boost/property_map/property_map.hpp>
32 template <
typename VertexT>
35 template <
typename VertexT>
40 using category = boost::read_write_property_map_tag;
44 template <
typename VertexT>
46 auto val = map.
map->find(key);
47 if (val != map.
map->end()) {
48 return val->second.cost;
50 return std::numeric_limits<double>::infinity();
53 template <
typename VertexT>
55 (*map.
map)[key].cost = value;
61 using VertexType =
typename boost::graph_traits<G>::vertex_descriptor;
62 using EdgeType =
typename boost::graph_traits<G>::edge_descriptor;
79 template <
typename Func>
81 using FuncT = std::remove_reference_t<Func>;
89 auto& state =
map_->at(v);
92 map_->at(state.predecessor).isLeaf = v == state.predecessor;
98 auto& predecessor = (*map_).at(boost::source(e, g));
99 auto& follower = (*map_)[boost::target(e, g)];
100 follower.length = predecessor.length + 1;
101 follower.predecessor = boost::source(e, g);
116 template <
typename Func>
121 auto inf = std::numeric_limits<double>::infinity();
123 boost::dijkstra_shortest_paths_no_color_map_no_init(
126 boost::closed_plus<double>{}, inf, 0., visitor);
void query(VertexType start, Func &&func)
DijkstraSearchMapType vertices_
double routingCost
Calculcated routing cost. Infinity if not routable.
bool operator()(EdgeType e) const
DijkstraSearchMapType * map_
RoutingGraphGraph::Vertex predecessor
The vertex this refers to.
size_t numLaneChanges
Required lane changes along the shortest path in order to get here.
@ Successor
A (the only) direct, reachable successor. Not merging and not diverging.
void examine_vertex(VertexType v, const SearchGraph &)
const DijkstraSearchMapType & getMap() const
Returns the result.
void edge_relaxed(EdgeType e, const SearchGraph &g)
std::remove_reference_t< Func > FuncT
SparseColorMap::value_type get(const SparseColorMap &map, LaneletVertexId key)
bool predicate
False if disabled by predicate.
typename boost::graph_traits< GraphType >::vertex_descriptor Vertex
typename boost::graph_traits< G >::edge_descriptor EdgeType
typename boost::graph_traits< G >::vertex_descriptor VertexType
bool isLeaf
True if it has no successor that is on the shortest path.
LeafFilter(const DijkstraSearchMapType &m, const G &g)
const DijkstraSearchMapType * m_
DijkstraStyleSearch(const G &graph)
Constructor for the graph search.
std::map< VertexT, VertexState > DijkstraSearchMap
boost::read_write_property_map_tag category
DijkstraSearchMap< VertexT > * map
DijkstraSearchMap< VertexType > DijkstraSearchMapType
double cost
Current accumulated cost.
DijkstraStyleVisitor()=default
std::function< bool(const VertexVisitInformation &)> VisitCallback
size_t length
Number of vertices to this vertex (including this one)
DijkstraStyleVisitor(DijkstraSearchMapType &map, FuncT *cb)
boost::filtered_graph< G, LeafFilter > SearchGraph
DijkstraCostMap< VertexT >::value_type get(const DijkstraCostMap< VertexT > &map, VertexT key)
void put(SparseColorMap &map, LaneletVertexId key, SparseColorMap::value_type value)
lanelet2_routing
Author(s): Matthias Mayr
autogenerated on Sun Oct 27 2024 02:27:49