Skip to content

Commit

Permalink
Flickering of route was caused by rounding error in NNGrid. Fixes ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Dec 2, 2011
1 parent b4585f2 commit bd2080f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions DataStructures/NNGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,6 @@ class NNGrid {
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
if(DoubleEpsilonCompare(dist, tmpDist) && 1 == std::abs((int)candidate.edgeBasedNode-(int)resultNode.edgeBasedNode)) {
resultNode.weight2 = candidate.weight;
/* if(resultNode.weight1 != resultNode.weight2) {
ERR("w1: " << resultNode.weight1 << ", w2: " << resultNode.weight2);
assert(false);
}*/
if(candidate.edgeBasedNode < resultNode.edgeBasedNode) {
resultNode.edgeBasedNode = candidate.edgeBasedNode;
std::swap(resultNode.weight1, resultNode.weight2);
Expand Down Expand Up @@ -412,7 +408,7 @@ class NNGrid {
}

inline bool DoubleEpsilonCompare(const double d1, const double d2) {
return (std::fabs(d1 - d2) < 0.000000001);
return (std::fabs(d1 - d2) < 0.0001);
}

unsigned FillCell(std::vector<GridEntry>& entriesWithSameRAMIndex, unsigned fileOffset ) {
Expand Down

0 comments on commit bd2080f

Please sign in to comment.