New auxiliary method
This commit is contained in:
parent
43bbf953c1
commit
94c8c61a05
@ -170,6 +170,30 @@ public:
|
||||
return _upperbound/10;
|
||||
}
|
||||
|
||||
unsigned int ComputeDistanceBetweenNodes(NodeID start, NodeID target)
|
||||
{
|
||||
_Heap * _forwardHeap = new _Heap(_graph->GetNumberOfNodes());
|
||||
_Heap * _backwardHeap = new _Heap(_graph->GetNumberOfNodes());
|
||||
NodeID middle = ( NodeID ) 0;
|
||||
unsigned int _upperbound = std::numeric_limits<unsigned int>::max();
|
||||
|
||||
_forwardHeap->Insert(start, 0, start);
|
||||
_backwardHeap->Insert(target, 0, target);
|
||||
|
||||
while(_forwardHeap->Size() + _backwardHeap->Size() > 0)
|
||||
{
|
||||
if ( _forwardHeap->Size() > 0 ) {
|
||||
_RoutingStep( _forwardHeap, _backwardHeap, true, &middle, &_upperbound );
|
||||
}
|
||||
if ( _backwardHeap->Size() > 0 ) {
|
||||
_RoutingStep( _backwardHeap, _forwardHeap, false, &middle, &_upperbound );
|
||||
}
|
||||
}
|
||||
delete _forwardHeap;
|
||||
delete _backwardHeap;
|
||||
return _upperbound;
|
||||
}
|
||||
|
||||
inline unsigned int findNearestNodeForLatLon(const _Coordinate& coord, _Coordinate& result) const
|
||||
{
|
||||
nodeHelpDesk->findNearestNodeIDForLatLon( coord, result );
|
||||
|
Loading…
Reference in New Issue
Block a user