osrm-backend/src/engine/routing_algorithms/routing_base.cpp
Kajari Ghosh 5597415f28
Revert "Improve speed of Map Matching" (#5196)
* Revert "Update changelog"

This reverts commit 9b779c704f.

* Revert "Fix formating"

This reverts commit 5bd7d04fe3.

* Revert "Fix bug in computation of distance offset for phantom node"

This reverts commit 0f78f7b2cc.

* Revert "Adjust text cases for flightly different matching due to rounding"

This reverts commit 8473be69d2.

* Revert "Round network distance to deci-meter to retain previous behavior"

This reverts commit c0124f7d77.

* Revert "Preserve heap state in map matching"

This reverts commit b630b4e32a.

* Revert "Use distance functions from many to many"

This reverts commit 89fabc1b9c.

* Revert "Use FCC algorithm for map matching distance calculation"

This reverts commit a649a8a5cf.
2018-09-06 12:05:28 -04:00

39 lines
1.2 KiB
C++

#include "engine/routing_algorithms/routing_base.hpp"
namespace osrm
{
namespace engine
{
namespace routing_algorithms
{
bool needsLoopForward(const PhantomNode &source_phantom, const PhantomNode &target_phantom)
{
return source_phantom.IsValidForwardSource() && target_phantom.IsValidForwardTarget() &&
source_phantom.forward_segment_id.id == target_phantom.forward_segment_id.id &&
source_phantom.GetForwardWeightPlusOffset() >
target_phantom.GetForwardWeightPlusOffset();
}
bool needsLoopBackwards(const PhantomNode &source_phantom, const PhantomNode &target_phantom)
{
return source_phantom.IsValidReverseSource() && target_phantom.IsValidReverseTarget() &&
source_phantom.reverse_segment_id.id == target_phantom.reverse_segment_id.id &&
source_phantom.GetReverseWeightPlusOffset() >
target_phantom.GetReverseWeightPlusOffset();
}
bool needsLoopForward(const PhantomNodes &phantoms)
{
return needsLoopForward(phantoms.source_phantom, phantoms.target_phantom);
}
bool needsLoopBackwards(const PhantomNodes &phantoms)
{
return needsLoopBackwards(phantoms.source_phantom, phantoms.target_phantom);
}
} // namespace routing_algorithms
} // namespace engine
} // namespace osrm