fix check for invalid phantom nodes (20 failed left)
This commit is contained in:
parent
776ac3bb2a
commit
2861bacd2a
@ -113,7 +113,7 @@ struct PhantomNode {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct PhantomNodes {
|
struct PhantomNodes {
|
||||||
//TODO: rename to lower-case non-camel
|
//TODO: rename to lower-case non-camel source_*,target_*
|
||||||
PhantomNode startPhantom;
|
PhantomNode startPhantom;
|
||||||
PhantomNode targetPhantom;
|
PhantomNode targetPhantom;
|
||||||
void Reset() {
|
void Reset() {
|
||||||
@ -125,9 +125,9 @@ struct PhantomNodes {
|
|||||||
return (startPhantom.forward_node_id == targetPhantom.forward_node_id);
|
return (startPhantom.forward_node_id == targetPhantom.forward_node_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Rename to: BothPhantomNodesAreInvalid
|
bool AtLeastOnePhantomNodeIsInvalid() const {
|
||||||
bool AtLeastOnePhantomNodeIsUINTMAX() const {
|
return ((startPhantom.forward_node_id == SPECIAL_NODEID) && (startPhantom.reverse_node_id == SPECIAL_NODEID)) ||
|
||||||
return (startPhantom.forward_node_id == SPECIAL_NODEID) && (targetPhantom.reverse_node_id == SPECIAL_NODEID);
|
((targetPhantom.forward_node_id == SPECIAL_NODEID) && (targetPhantom.reverse_node_id == SPECIAL_NODEID));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PhantomNodesHaveEqualLocation() const {
|
bool PhantomNodesHaveEqualLocation() const {
|
||||||
|
@ -87,7 +87,7 @@ public:
|
|||||||
RawRouteData & raw_route_data
|
RawRouteData & raw_route_data
|
||||||
) {
|
) {
|
||||||
SimpleLogger().Write(logDEBUG) << "alt path routing";
|
SimpleLogger().Write(logDEBUG) << "alt path routing";
|
||||||
if( //phantom_node_pair.AtLeastOnePhantomNodeIsUINTMAX() ||
|
if( //phantom_node_pair.AtLeastOnePhantomNodeIsInvalid() ||
|
||||||
phantom_node_pair.PhantomNodesHaveEqualLocation()
|
phantom_node_pair.PhantomNodesHaveEqualLocation()
|
||||||
) {
|
) {
|
||||||
// raw_route_data.lengthOfShortestPath = INVALID_EDGE_WEIGHT;
|
// raw_route_data.lengthOfShortestPath = INVALID_EDGE_WEIGHT;
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
const PhantomNodes & phantom_node_pair,
|
const PhantomNodes & phantom_node_pair,
|
||||||
phantom_nodes_vector
|
phantom_nodes_vector
|
||||||
){
|
){
|
||||||
if( phantom_node_pair.AtLeastOnePhantomNodeIsUINTMAX() ) {
|
if( phantom_node_pair.AtLeastOnePhantomNodeIsInvalid() ) {
|
||||||
// raw_route_data.lengthOfShortestPath = INT_MAX;
|
// raw_route_data.lengthOfShortestPath = INT_MAX;
|
||||||
// raw_route_data.lengthOfAlternativePath = INT_MAX;
|
// raw_route_data.lengthOfAlternativePath = INT_MAX;
|
||||||
SimpleLogger().Write(logDEBUG) << "returning early";
|
SimpleLogger().Write(logDEBUG) << "returning early";
|
||||||
|
Loading…
Reference in New Issue
Block a user