* Revert "Update changelog" This reverts commit9b779c704f
. * Revert "Fix formating" This reverts commit5bd7d04fe3
. * Revert "Fix bug in computation of distance offset for phantom node" This reverts commit0f78f7b2cc
. * Revert "Adjust text cases for flightly different matching due to rounding" This reverts commit8473be69d2
. * Revert "Round network distance to deci-meter to retain previous behavior" This reverts commitc0124f7d77
. * Revert "Preserve heap state in map matching" This reverts commitb630b4e32a
. * Revert "Use distance functions from many to many" This reverts commit89fabc1b9c
. * Revert "Use FCC algorithm for map matching distance calculation" This reverts commita649a8a5cf
.
39 lines
1.2 KiB
C++
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
|