diff --git a/DataStructures/PhantomNodes.h b/DataStructures/PhantomNodes.h index 9b7076f08..e74af6db5 100644 --- a/DataStructures/PhantomNodes.h +++ b/DataStructures/PhantomNodes.h @@ -113,7 +113,7 @@ struct PhantomNode { }; struct PhantomNodes { - //TODO: rename to lower-case non-camel + //TODO: rename to lower-case non-camel source_*,target_* PhantomNode startPhantom; PhantomNode targetPhantom; void Reset() { @@ -125,9 +125,9 @@ struct PhantomNodes { return (startPhantom.forward_node_id == targetPhantom.forward_node_id); } - //TODO: Rename to: BothPhantomNodesAreInvalid - bool AtLeastOnePhantomNodeIsUINTMAX() const { - return (startPhantom.forward_node_id == SPECIAL_NODEID) && (targetPhantom.reverse_node_id == SPECIAL_NODEID); + bool AtLeastOnePhantomNodeIsInvalid() const { + return ((startPhantom.forward_node_id == SPECIAL_NODEID) && (startPhantom.reverse_node_id == SPECIAL_NODEID)) || + ((targetPhantom.forward_node_id == SPECIAL_NODEID) && (targetPhantom.reverse_node_id == SPECIAL_NODEID)); } bool PhantomNodesHaveEqualLocation() const { diff --git a/RoutingAlgorithms/AlternativePathRouting.h b/RoutingAlgorithms/AlternativePathRouting.h index cd10e28ba..05a2895e4 100644 --- a/RoutingAlgorithms/AlternativePathRouting.h +++ b/RoutingAlgorithms/AlternativePathRouting.h @@ -87,7 +87,7 @@ public: RawRouteData & raw_route_data ) { SimpleLogger().Write(logDEBUG) << "alt path routing"; - if( //phantom_node_pair.AtLeastOnePhantomNodeIsUINTMAX() || + if( //phantom_node_pair.AtLeastOnePhantomNodeIsInvalid() || phantom_node_pair.PhantomNodesHaveEqualLocation() ) { // raw_route_data.lengthOfShortestPath = INVALID_EDGE_WEIGHT; diff --git a/RoutingAlgorithms/ShortestPathRouting.h b/RoutingAlgorithms/ShortestPathRouting.h index 1778e00d7..2dbcea798 100644 --- a/RoutingAlgorithms/ShortestPathRouting.h +++ b/RoutingAlgorithms/ShortestPathRouting.h @@ -60,7 +60,7 @@ public: const PhantomNodes & phantom_node_pair, phantom_nodes_vector ){ - if( phantom_node_pair.AtLeastOnePhantomNodeIsUINTMAX() ) { + if( phantom_node_pair.AtLeastOnePhantomNodeIsInvalid() ) { // raw_route_data.lengthOfShortestPath = INT_MAX; // raw_route_data.lengthOfAlternativePath = INT_MAX; SimpleLogger().Write(logDEBUG) << "returning early";