Fixes cucumber test features/bad.feature:15
This commit is contained in:
parent
bd6f2db1d1
commit
c16c2adeda
@ -42,7 +42,9 @@ struct _Coordinate {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
bool operator==(const _Coordinate & other) const {
|
||||||
|
return lat == other.lat && lon == other.lon;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::ostream & operator<<(std::ostream & out, const _Coordinate & c){
|
inline std::ostream & operator<<(std::ostream & out, const _Coordinate & c){
|
||||||
|
@ -45,6 +45,10 @@ struct PhantomNode {
|
|||||||
bool isValid(const unsigned numberOfNodes) const {
|
bool isValid(const unsigned numberOfNodes) const {
|
||||||
return location.isValid() && (edgeBasedNode < numberOfNodes) && (weight1 != INT_MAX) && (ratio >= 0.) && (ratio <= 1.) && (nodeBasedEdgeNameID != UINT_MAX);
|
return location.isValid() && (edgeBasedNode < numberOfNodes) && (weight1 != INT_MAX) && (ratio >= 0.) && (ratio <= 1.) && (nodeBasedEdgeNameID != UINT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator==(const PhantomNode & other) const {
|
||||||
|
return location == other.location;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PhantomNodes {
|
struct PhantomNodes {
|
||||||
@ -62,6 +66,10 @@ struct PhantomNodes {
|
|||||||
bool AtLeastOnePhantomNodeIsUINTMAX() const {
|
bool AtLeastOnePhantomNodeIsUINTMAX() const {
|
||||||
return !(startPhantom.edgeBasedNode == UINT_MAX || targetPhantom.edgeBasedNode == UINT_MAX);
|
return !(startPhantom.edgeBasedNode == UINT_MAX || targetPhantom.edgeBasedNode == UINT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PhantomNodesHaveEqualLocation() const {
|
||||||
|
return startPhantom == targetPhantom;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::ostream& operator<<(std::ostream &out, const PhantomNodes & pn){
|
inline std::ostream& operator<<(std::ostream &out, const PhantomNodes & pn){
|
||||||
|
@ -52,10 +52,11 @@ public:
|
|||||||
~AlternativeRouting() {}
|
~AlternativeRouting() {}
|
||||||
|
|
||||||
void operator()(const PhantomNodes & phantomNodePair, RawRouteData & rawRouteData) {
|
void operator()(const PhantomNodes & phantomNodePair, RawRouteData & rawRouteData) {
|
||||||
if(!phantomNodePair.AtLeastOnePhantomNodeIsUINTMAX()) {
|
if(!phantomNodePair.AtLeastOnePhantomNodeIsUINTMAX() || phantomNodePair.PhantomNodesHaveEqualLocation()) {
|
||||||
rawRouteData.lengthOfShortestPath = rawRouteData.lengthOfAlternativePath = INT_MAX;
|
rawRouteData.lengthOfShortestPath = rawRouteData.lengthOfAlternativePath = INT_MAX;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<NodeID> alternativePath;
|
std::vector<NodeID> alternativePath;
|
||||||
std::vector<NodeID> viaNodeCandidates;
|
std::vector<NodeID> viaNodeCandidates;
|
||||||
std::deque <NodeID> packedShortestPath;
|
std::deque <NodeID> packedShortestPath;
|
||||||
|
Loading…
Reference in New Issue
Block a user