reformat SCC class, make sure road distances are not counted twice
This commit is contained in:
		
							parent
							
								
									53c102e1e9
								
							
						
					
					
						commit
						a7eb89b2f0
					
				| @ -81,13 +81,14 @@ class TarjanSCC | ||||
| 
 | ||||
|     struct TarjanEdgeData | ||||
|     { | ||||
|         TarjanEdgeData() | ||||
|             : distance(INVALID_EDGE_WEIGHT), name_id(INVALID_NAMEID) | ||||
|         TarjanEdgeData() : distance(INVALID_EDGE_WEIGHT), name_id(INVALID_NAMEID) {} | ||||
|         TarjanEdgeData(int distance, unsigned name_id) //, bool shortcut, short type, bool forward,
 | ||||
|             // bool backward, bool reversedEdge) :
 | ||||
|             : distance(distance), | ||||
|               name_id(name_id) //, shortcut(shortcut), type(type), forward(forward),
 | ||||
|         // backward(backward), reversedEdge(reversedEdge)
 | ||||
|         { | ||||
|         } | ||||
|         TarjanEdgeData(int distance, unsigned name_id)//, bool shortcut, short type, bool forward, bool backward, bool reversedEdge) :
 | ||||
|          :distance(distance), name_id(name_id)//, shortcut(shortcut), type(type), forward(forward), backward(backward), reversedEdge(reversedEdge)
 | ||||
|         {} | ||||
|         int distance; | ||||
|         unsigned name_id; | ||||
|     }; | ||||
| @ -265,7 +266,7 @@ class TarjanSCC | ||||
|                     ++index; | ||||
| 
 | ||||
|                     // Traverse outgoing edges
 | ||||
|                     for (auto e2 : m_node_based_graph->GetAdjacentEdgeRange(v)) | ||||
|                     for (const auto e2 : m_node_based_graph->GetAdjacentEdgeRange(v)) | ||||
|                     { | ||||
|                         const TarjanDynamicGraph::NodeIterator vprime = | ||||
|                             m_node_based_graph->GetTarget(e2); | ||||
| @ -343,12 +344,15 @@ class TarjanSCC | ||||
|                 // }
 | ||||
|                 const TarjanDynamicGraph::NodeIterator v = m_node_based_graph->GetTarget(e1); | ||||
| 
 | ||||
|                 total_network_distance += 100 * FixedPointCoordinate::ApproximateEuclideanDistance( | ||||
|                 if (u < v || SPECIAL_EDGEID == m_node_based_graph->FindEdge(v, u)) | ||||
|                 { | ||||
|                     total_network_distance += | ||||
|                         100 * FixedPointCoordinate::ApproximateEuclideanDistance( | ||||
|                                   m_coordinate_list[u].lat, | ||||
|                                   m_coordinate_list[u].lon, | ||||
|                                   m_coordinate_list[v].lat, | ||||
|                                   m_coordinate_list[v].lon); | ||||
| 
 | ||||
|                 } | ||||
|                 if (true) // SHRT_MAX != m_node_based_graph->GetEdgeData(e1).type)
 | ||||
|                 { | ||||
|                     BOOST_ASSERT(e1 != SPECIAL_EDGEID); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user