@@ -34,8 +34,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace osrm
|
||||
@@ -93,9 +91,6 @@ struct PhantomNode
|
||||
// x <-- this is PhantomNode.location
|
||||
// 0----1----2----3----4 <-- EdgeBasedGraph Node segments
|
||||
BOOST_ASSERT(forward_segment_id.enabled);
|
||||
std::cout << "forward_distance: " << forward_distance;
|
||||
std::cout << " forward_distance_offset: " << forward_distance_offset;
|
||||
std::cout << std::endl;
|
||||
return forward_distance + forward_distance_offset;
|
||||
}
|
||||
|
||||
@@ -107,9 +102,6 @@ struct PhantomNode
|
||||
// x <-- this is PhantomNode.location
|
||||
// 0----1----2----3----4 <-- EdgeBasedGraph Node segments
|
||||
BOOST_ASSERT(reverse_segment_id.enabled);
|
||||
std::cout << "reverse_distance: " << reverse_distance;
|
||||
std::cout << " reverse_distance_offset: " << reverse_distance_offset;
|
||||
std::cout << std::endl;
|
||||
return reverse_distance + reverse_distance_offset;
|
||||
}
|
||||
|
||||
@@ -242,7 +234,7 @@ struct PhantomNodes
|
||||
PhantomNode source_phantom;
|
||||
PhantomNode target_phantom;
|
||||
};
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PHANTOM_NODES_H
|
||||
|
||||
@@ -25,17 +25,15 @@ struct NodeBucket
|
||||
unsigned from_clique_arc : 1;
|
||||
EdgeWeight weight;
|
||||
EdgeDuration duration;
|
||||
EdgeDistance distance;
|
||||
|
||||
NodeBucket(NodeID middle_node,
|
||||
NodeID parent_node,
|
||||
bool from_clique_arc,
|
||||
unsigned column_index,
|
||||
EdgeWeight weight,
|
||||
EdgeDuration duration,
|
||||
EdgeDistance distance)
|
||||
EdgeDuration duration)
|
||||
: middle_node(middle_node), parent_node(parent_node), column_index(column_index),
|
||||
from_clique_arc(from_clique_arc), weight(weight), duration(duration), distance(distance)
|
||||
from_clique_arc(from_clique_arc), weight(weight), duration(duration)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -43,10 +41,9 @@ struct NodeBucket
|
||||
NodeID parent_node,
|
||||
unsigned column_index,
|
||||
EdgeWeight weight,
|
||||
EdgeDuration duration,
|
||||
EdgeDistance distance)
|
||||
EdgeDuration duration)
|
||||
: middle_node(middle_node), parent_node(parent_node), column_index(column_index),
|
||||
from_clique_arc(false), weight(weight), duration(duration), distance(distance)
|
||||
from_clique_arc(false), weight(weight), duration(duration)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -85,17 +85,13 @@ void insertSourceInHeap(ManyToManyQueryHeap &heap, const PhantomNode &phantom_no
|
||||
{
|
||||
heap.Insert(phantom_node.forward_segment_id.id,
|
||||
-phantom_node.GetForwardWeightPlusOffset(),
|
||||
{phantom_node.forward_segment_id.id,
|
||||
-phantom_node.GetForwardDuration(),
|
||||
-phantom_node.GetForwardDistance()});
|
||||
{phantom_node.forward_segment_id.id, -phantom_node.GetForwardDuration()});
|
||||
}
|
||||
if (phantom_node.IsValidReverseSource())
|
||||
{
|
||||
heap.Insert(phantom_node.reverse_segment_id.id,
|
||||
-phantom_node.GetReverseWeightPlusOffset(),
|
||||
{phantom_node.reverse_segment_id.id,
|
||||
-phantom_node.GetReverseDuration(),
|
||||
-phantom_node.GetReverseDistance()});
|
||||
{phantom_node.reverse_segment_id.id, -phantom_node.GetReverseDuration()});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,17 +102,13 @@ void insertTargetInHeap(ManyToManyQueryHeap &heap, const PhantomNode &phantom_no
|
||||
{
|
||||
heap.Insert(phantom_node.forward_segment_id.id,
|
||||
phantom_node.GetForwardWeightPlusOffset(),
|
||||
{phantom_node.forward_segment_id.id,
|
||||
phantom_node.GetForwardDuration(),
|
||||
phantom_node.GetForwardDistance()});
|
||||
{phantom_node.forward_segment_id.id, phantom_node.GetForwardDuration()});
|
||||
}
|
||||
if (phantom_node.IsValidReverseTarget())
|
||||
{
|
||||
heap.Insert(phantom_node.reverse_segment_id.id,
|
||||
phantom_node.GetReverseWeightPlusOffset(),
|
||||
{phantom_node.reverse_segment_id.id,
|
||||
phantom_node.GetReverseDuration(),
|
||||
phantom_node.GetReverseDistance()});
|
||||
{phantom_node.reverse_segment_id.id, phantom_node.GetReverseDuration()});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -186,10 +186,9 @@ void routingStep(const DataFacade<Algorithm> &facade,
|
||||
}
|
||||
|
||||
template <bool UseDuration>
|
||||
std::tuple<EdgeWeight,EdgeDistance> getLoopWeight(const DataFacade<Algorithm> &facade, NodeID node)
|
||||
EdgeWeight getLoopWeight(const DataFacade<Algorithm> &facade, NodeID node)
|
||||
{
|
||||
EdgeWeight loop_weight = UseDuration ? MAXIMAL_EDGE_DURATION : INVALID_EDGE_WEIGHT;
|
||||
EdgeDistance loop_distance = MAXIMAL_EDGE_DISTANCE;
|
||||
for (auto edge : facade.GetAdjacentEdgeRange(node))
|
||||
{
|
||||
const auto &data = facade.GetEdgeData(edge);
|
||||
@@ -199,15 +198,11 @@ std::tuple<EdgeWeight,EdgeDistance> getLoopWeight(const DataFacade<Algorithm> &f
|
||||
if (to == node)
|
||||
{
|
||||
const auto value = UseDuration ? data.duration : data.weight;
|
||||
if (value < loop_weight)
|
||||
{
|
||||
loop_weight = value;
|
||||
loop_distance = data.distance;
|
||||
}
|
||||
loop_weight = std::min(loop_weight, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::make_tuple(loop_weight, loop_distance);
|
||||
return loop_weight;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,11 +30,7 @@ struct HeapData
|
||||
struct ManyToManyHeapData : HeapData
|
||||
{
|
||||
EdgeWeight duration;
|
||||
EdgeDistance distance;
|
||||
ManyToManyHeapData(NodeID p, EdgeWeight duration, EdgeDistance distance)
|
||||
: HeapData(p), duration(duration), distance(distance)
|
||||
{
|
||||
}
|
||||
ManyToManyHeapData(NodeID p, EdgeWeight duration) : HeapData(p), duration(duration) {}
|
||||
};
|
||||
|
||||
template <> struct SearchEngineData<routing_algorithms::ch::Algorithm>
|
||||
@@ -79,16 +75,12 @@ struct MultiLayerDijkstraHeapData
|
||||
struct ManyToManyMultiLayerDijkstraHeapData : MultiLayerDijkstraHeapData
|
||||
{
|
||||
EdgeWeight duration;
|
||||
EdgeDistance distance;
|
||||
ManyToManyMultiLayerDijkstraHeapData(NodeID p, EdgeWeight duration, EdgeDistance distance)
|
||||
: MultiLayerDijkstraHeapData(p), duration(duration), distance(distance)
|
||||
ManyToManyMultiLayerDijkstraHeapData(NodeID p, EdgeWeight duration)
|
||||
: MultiLayerDijkstraHeapData(p), duration(duration)
|
||||
{
|
||||
}
|
||||
ManyToManyMultiLayerDijkstraHeapData(NodeID p,
|
||||
bool from,
|
||||
EdgeWeight duration,
|
||||
EdgeDistance distance)
|
||||
: MultiLayerDijkstraHeapData(p, from), duration(duration), distance(distance)
|
||||
ManyToManyMultiLayerDijkstraHeapData(NodeID p, bool from, EdgeWeight duration)
|
||||
: MultiLayerDijkstraHeapData(p, from), duration(duration)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -120,7 +112,7 @@ template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
|
||||
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes,
|
||||
unsigned number_of_boundary_nodes);
|
||||
};
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SEARCH_ENGINE_DATA_HPP
|
||||
|
||||
Reference in New Issue
Block a user