Apollo 10.0
自动驾驶开放平台
apollo::routing::SubTopoGraph类 参考

#include <sub_topo_graph.h>

apollo::routing::SubTopoGraph 的协作图:

Public 成员函数

 SubTopoGraph (const std::unordered_map< const TopoNode *, std::vector< NodeSRange > > &black_map)
 
 ~SubTopoGraph ()
 
void GetSubInEdgesIntoSubGraph (const TopoEdge *edge, std::unordered_set< const TopoEdge * > *const sub_edges) const
 
void GetSubOutEdgesIntoSubGraph (const TopoEdge *edge, std::unordered_set< const TopoEdge * > *const sub_edges) const
 
const TopoNodeGetSubNodeWithS (const TopoNode *topo_node, double s) const
 

详细描述

在文件 sub_topo_graph.h29 行定义.

构造及析构函数说明

◆ SubTopoGraph()

apollo::routing::SubTopoGraph::SubTopoGraph ( const std::unordered_map< const TopoNode *, std::vector< NodeSRange > > &  black_map)

在文件 sub_topo_graph.cc94 行定义.

96 {
97 std::vector<NodeSRange> valid_range;
98 for (const auto& map_iter : black_map) {
99 valid_range.clear();
100 GetSortedValidRange(map_iter.first, map_iter.second, &valid_range);
101 InitSubNodeByValidRange(map_iter.first, valid_range);
102 }
103
104 for (const auto& map_iter : black_map) {
105 InitSubEdge(map_iter.first);
106 }
107
108 for (const auto& map_iter : black_map) {
109 AddPotentialEdge(map_iter.first);
110 }
111}

◆ ~SubTopoGraph()

apollo::routing::SubTopoGraph::~SubTopoGraph ( )

在文件 sub_topo_graph.cc113 行定义.

113{}

成员函数说明

◆ GetSubInEdgesIntoSubGraph()

void apollo::routing::SubTopoGraph::GetSubInEdgesIntoSubGraph ( const TopoEdge edge,
std::unordered_set< const TopoEdge * > *const  sub_edges 
) const

在文件 sub_topo_graph.cc115 行定义.

117 {
118 const auto* from_node = edge->FromNode();
119 const auto* to_node = edge->ToNode();
120 std::unordered_set<TopoNode*> sub_nodes;
121 if (from_node->IsSubNode() || to_node->IsSubNode() ||
122 !GetSubNodes(to_node, &sub_nodes)) {
123 sub_edges->insert(edge);
124 return;
125 }
126 for (const auto* sub_node : sub_nodes) {
127 for (const auto* in_edge : sub_node->InFromAllEdge()) {
128 if (in_edge->FromNode() == from_node) {
129 sub_edges->insert(in_edge);
130 }
131 }
132 }
133}

◆ GetSubNodeWithS()

const TopoNode * apollo::routing::SubTopoGraph::GetSubNodeWithS ( const TopoNode topo_node,
double  s 
) const

在文件 sub_topo_graph.cc155 行定义.

156 {
157 const auto& map_iter = sub_node_range_sorted_map_.find(topo_node);
158 if (map_iter == sub_node_range_sorted_map_.end()) {
159 return topo_node;
160 }
161 const auto& sorted_vec = map_iter->second;
162 // sorted vec can't be empty!
163 int index = BinarySearchForStartS(sorted_vec, s);
164 if (index < 0) {
165 return nullptr;
166 }
167 return sorted_vec[index].GetTopoNode();
168}
const TopoNode * topo_node
int BinarySearchForStartS(const std::vector< T > &sorted_vec, double value_s)
Definition range_utils.h:91

◆ GetSubOutEdgesIntoSubGraph()

void apollo::routing::SubTopoGraph::GetSubOutEdgesIntoSubGraph ( const TopoEdge edge,
std::unordered_set< const TopoEdge * > *const  sub_edges 
) const

在文件 sub_topo_graph.cc135 行定义.

137 {
138 const auto* from_node = edge->FromNode();
139 const auto* to_node = edge->ToNode();
140 std::unordered_set<TopoNode*> sub_nodes;
141 if (from_node->IsSubNode() || to_node->IsSubNode() ||
142 !GetSubNodes(from_node, &sub_nodes)) {
143 sub_edges->insert(edge);
144 return;
145 }
146 for (const auto* sub_node : sub_nodes) {
147 for (const auto* out_edge : sub_node->OutToAllEdge()) {
148 if (out_edge->ToNode() == to_node) {
149 sub_edges->insert(out_edge);
150 }
151 }
152 }
153}

该类的文档由以下文件生成: