Add EBG node durations
This commit is contained in:
parent
db18e8669f
commit
fd9bebbfa7
@ -76,6 +76,8 @@ class MultiLevelGraph : public partitioner::MultiLevelGraph<EdgeDataT, Ownership
|
|||||||
|
|
||||||
EdgeWeight GetNodeWeight(NodeID node) const { return node_weights[node]; }
|
EdgeWeight GetNodeWeight(NodeID node) const { return node_weights[node]; }
|
||||||
|
|
||||||
|
EdgeWeight GetNodeDuration(NodeID node) const { return node_durations[node]; }
|
||||||
|
|
||||||
friend void
|
friend void
|
||||||
serialization::read<EdgeDataT, Ownership>(storage::tar::FileReader &reader,
|
serialization::read<EdgeDataT, Ownership>(storage::tar::FileReader &reader,
|
||||||
const std::string &name,
|
const std::string &name,
|
||||||
|
@ -692,9 +692,9 @@ template <> class ContiguousInternalMemoryAlgorithmDataFacade<MLD> : public Algo
|
|||||||
return query_graph.GetNodeWeight(node);
|
return query_graph.GetNodeWeight(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
EdgeDuration GetNodeDuration(const NodeID) const override final
|
EdgeDuration GetNodeDuration(const NodeID node) const override final
|
||||||
{
|
{
|
||||||
return 0; // TODO: query_graph.GetNodeduration(node);
|
return query_graph.GetNodeDuration(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeID GetTarget(const EdgeID e) const override final { return query_graph.GetTarget(e); }
|
NodeID GetTarget(const EdgeID e) const override final { return query_graph.GetTarget(e); }
|
||||||
|
@ -91,6 +91,7 @@ class EdgeBasedGraphFactory
|
|||||||
void GetEdgeBasedNodeSegments(std::vector<EdgeBasedNodeSegment> &nodes);
|
void GetEdgeBasedNodeSegments(std::vector<EdgeBasedNodeSegment> &nodes);
|
||||||
void GetStartPointMarkers(std::vector<bool> &node_is_startpoint);
|
void GetStartPointMarkers(std::vector<bool> &node_is_startpoint);
|
||||||
void GetEdgeBasedNodeWeights(std::vector<EdgeWeight> &output_node_weights);
|
void GetEdgeBasedNodeWeights(std::vector<EdgeWeight> &output_node_weights);
|
||||||
|
void GetEdgeBasedNodeDurations(std::vector<EdgeWeight> &output_node_durations);
|
||||||
std::uint32_t GetConnectivityChecksum() const;
|
std::uint32_t GetConnectivityChecksum() const;
|
||||||
|
|
||||||
std::uint64_t GetNumberOfEdgeBasedNodes() const;
|
std::uint64_t GetNumberOfEdgeBasedNodes() const;
|
||||||
@ -117,6 +118,7 @@ class EdgeBasedGraphFactory
|
|||||||
//! node weights that indicate the length of the segment (node based) represented by the
|
//! node weights that indicate the length of the segment (node based) represented by the
|
||||||
//! edge-based node
|
//! edge-based node
|
||||||
std::vector<EdgeWeight> m_edge_based_node_weights;
|
std::vector<EdgeWeight> m_edge_based_node_weights;
|
||||||
|
std::vector<EdgeDuration> m_edge_based_node_durations;
|
||||||
|
|
||||||
//! list of edge based nodes (compressed segments)
|
//! list of edge based nodes (compressed segments)
|
||||||
std::vector<EdgeBasedNodeSegment> m_edge_based_node_segments;
|
std::vector<EdgeBasedNodeSegment> m_edge_based_node_segments;
|
||||||
|
@ -87,6 +87,7 @@ class Extractor
|
|||||||
std::vector<EdgeBasedNodeSegment> &edge_based_node_segments,
|
std::vector<EdgeBasedNodeSegment> &edge_based_node_segments,
|
||||||
std::vector<bool> &node_is_startpoint,
|
std::vector<bool> &node_is_startpoint,
|
||||||
std::vector<EdgeWeight> &edge_based_node_weights,
|
std::vector<EdgeWeight> &edge_based_node_weights,
|
||||||
|
std::vector<EdgeDuration> &edge_based_node_durations,
|
||||||
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
||||||
std::uint32_t &connectivity_checksum);
|
std::uint32_t &connectivity_checksum);
|
||||||
|
|
||||||
|
@ -462,14 +462,28 @@ void readEdgeBasedNodeWeights(const boost::filesystem::path &path, NodeWeigtsVec
|
|||||||
storage::serialization::read(reader, "/extractor/edge_based_node_weights", weights);
|
storage::serialization::read(reader, "/extractor/edge_based_node_weights", weights);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename NodeWeigtsVectorT>
|
template <typename NodeWeigtsVectorT, typename NodeDurationsVectorT>
|
||||||
void writeEdgeBasedNodeWeights(const boost::filesystem::path &path,
|
void readEdgeBasedNodeWeightsDurations(const boost::filesystem::path &path,
|
||||||
const NodeWeigtsVectorT &weights)
|
NodeWeigtsVectorT &weights,
|
||||||
|
NodeDurationsVectorT &durations)
|
||||||
|
{
|
||||||
|
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
|
||||||
|
storage::tar::FileReader reader{path, fingerprint};
|
||||||
|
|
||||||
|
storage::serialization::read(reader, "/extractor/edge_based_node_weights", weights);
|
||||||
|
storage::serialization::read(reader, "/extractor/edge_based_node_durations", durations);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename NodeWeigtsVectorT, typename NodeDurationsVectorT>
|
||||||
|
void writeEdgeBasedNodeWeightsDurations(const boost::filesystem::path &path,
|
||||||
|
const NodeWeigtsVectorT &weights,
|
||||||
|
const NodeDurationsVectorT &durations)
|
||||||
{
|
{
|
||||||
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
|
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
|
||||||
storage::tar::FileWriter writer{path, fingerprint};
|
storage::tar::FileWriter writer{path, fingerprint};
|
||||||
|
|
||||||
storage::serialization::write(writer, "/extractor/edge_based_node_weights", weights);
|
storage::serialization::write(writer, "/extractor/edge_based_node_weights", weights);
|
||||||
|
storage::serialization::write(writer, "/extractor/edge_based_node_durations", durations);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename RTreeT>
|
template <typename RTreeT>
|
||||||
|
@ -17,13 +17,15 @@ class Updater
|
|||||||
public:
|
public:
|
||||||
Updater(UpdaterConfig config_) : config(std::move(config_)) {}
|
Updater(UpdaterConfig config_) : config(std::move(config_)) {}
|
||||||
|
|
||||||
using NumNodesAndEdges =
|
EdgeID
|
||||||
std::tuple<EdgeID, std::vector<extractor::EdgeBasedEdge>, std::uint32_t>;
|
LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
NumNodesAndEdges LoadAndUpdateEdgeExpandedGraph() const;
|
std::vector<EdgeWeight> &node_weights,
|
||||||
|
std::uint32_t &connectivity_checksum) const;
|
||||||
|
|
||||||
EdgeID
|
EdgeID
|
||||||
LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
std::vector<EdgeWeight> &node_weights,
|
std::vector<EdgeWeight> &node_weights,
|
||||||
|
std::vector<EdgeDuration> &node_durations, // TODO: to be deleted
|
||||||
std::uint32_t &connectivity_checksum) const;
|
std::uint32_t &connectivity_checksum) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -75,13 +75,14 @@ void printUnreachableStatistics(const Partition &partition,
|
|||||||
auto LoadAndUpdateEdgeExpandedGraph(const CustomizationConfig &config,
|
auto LoadAndUpdateEdgeExpandedGraph(const CustomizationConfig &config,
|
||||||
const partitioner::MultiLevelPartition &mlp,
|
const partitioner::MultiLevelPartition &mlp,
|
||||||
std::vector<EdgeWeight> &node_weights,
|
std::vector<EdgeWeight> &node_weights,
|
||||||
|
std::vector<EdgeDuration> &node_durations,
|
||||||
std::uint32_t &connectivity_checksum)
|
std::uint32_t &connectivity_checksum)
|
||||||
{
|
{
|
||||||
updater::Updater updater(config.updater_config);
|
updater::Updater updater(config.updater_config);
|
||||||
|
|
||||||
std::vector<extractor::EdgeBasedEdge> edge_based_edge_list;
|
std::vector<extractor::EdgeBasedEdge> edge_based_edge_list;
|
||||||
EdgeID num_nodes = updater.LoadAndUpdateEdgeExpandedGraph(
|
EdgeID num_nodes = updater.LoadAndUpdateEdgeExpandedGraph(
|
||||||
edge_based_edge_list, node_weights, connectivity_checksum);
|
edge_based_edge_list, node_weights, node_durations, connectivity_checksum);
|
||||||
|
|
||||||
auto directed = partitioner::splitBidirectionalEdges(edge_based_edge_list);
|
auto directed = partitioner::splitBidirectionalEdges(edge_based_edge_list);
|
||||||
|
|
||||||
@ -123,8 +124,10 @@ int Customizer::Run(const CustomizationConfig &config)
|
|||||||
partitioner::files::readPartition(config.GetPath(".osrm.partition"), mlp);
|
partitioner::files::readPartition(config.GetPath(".osrm.partition"), mlp);
|
||||||
|
|
||||||
std::vector<EdgeWeight> node_weights;
|
std::vector<EdgeWeight> node_weights;
|
||||||
|
std::vector<EdgeDuration> node_durations; // TODO: to be removed later
|
||||||
std::uint32_t connectivity_checksum = 0;
|
std::uint32_t connectivity_checksum = 0;
|
||||||
auto graph = LoadAndUpdateEdgeExpandedGraph(config, mlp, node_weights, connectivity_checksum);
|
auto graph = LoadAndUpdateEdgeExpandedGraph(
|
||||||
|
config, mlp, node_weights, node_durations, connectivity_checksum);
|
||||||
BOOST_ASSERT(graph.GetNumberOfNodes() == node_weights.size());
|
BOOST_ASSERT(graph.GetNumberOfNodes() == node_weights.size());
|
||||||
std::for_each(node_weights.begin(), node_weights.end(), [](auto &w) { w &= 0x7fffffff; });
|
std::for_each(node_weights.begin(), node_weights.end(), [](auto &w) { w &= 0x7fffffff; });
|
||||||
util::Log() << "Loaded edge based graph: " << graph.GetNumberOfEdges() << " edges, "
|
util::Log() << "Loaded edge based graph: " << graph.GetNumberOfEdges() << " edges, "
|
||||||
@ -163,7 +166,6 @@ int Customizer::Run(const CustomizationConfig &config)
|
|||||||
util::Log() << "MLD customization writing took " << TIMER_SEC(writing_mld_data) << " seconds";
|
util::Log() << "MLD customization writing took " << TIMER_SEC(writing_mld_data) << " seconds";
|
||||||
|
|
||||||
TIMER_START(writing_graph);
|
TIMER_START(writing_graph);
|
||||||
std::vector<EdgeDuration> node_durations; // TODO: save an empty vector, to be removed later
|
|
||||||
MultiLevelEdgeBasedGraph shaved_graph{
|
MultiLevelEdgeBasedGraph shaved_graph{
|
||||||
std::move(graph), std::move(node_weights), std::move(node_durations)};
|
std::move(graph), std::move(node_weights), std::move(node_durations)};
|
||||||
customizer::files::writeGraph(
|
customizer::files::writeGraph(
|
||||||
|
@ -169,8 +169,6 @@ void relaxOutgoingEdges(const DataFacade<mld::Algorithm> &facade,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto node_weight = facade.GetNodeWeight(node);
|
|
||||||
const auto node_duration = facade.GetNodeDuration(node); // TODO: remove later
|
|
||||||
for (const auto edge : facade.GetBorderEdgeRange(level, node))
|
for (const auto edge : facade.GetBorderEdgeRange(level, node))
|
||||||
{
|
{
|
||||||
const auto &data = facade.GetEdgeData(edge);
|
const auto &data = facade.GetEdgeData(edge);
|
||||||
@ -183,6 +181,10 @@ void relaxOutgoingEdges(const DataFacade<mld::Algorithm> &facade,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto turn_id = data.turn_id;
|
const auto turn_id = data.turn_id;
|
||||||
|
const auto node_weight =
|
||||||
|
facade.GetNodeWeight(DIRECTION == FORWARD_DIRECTION ? node : to);
|
||||||
|
const auto node_duration = facade.GetNodeDuration(
|
||||||
|
DIRECTION == FORWARD_DIRECTION ? node : to); // TODO: remove later
|
||||||
const auto edge_weight = node_weight + facade.GetWeightPenaltyForEdgeID(turn_id);
|
const auto edge_weight = node_weight + facade.GetWeightPenaltyForEdgeID(turn_id);
|
||||||
const auto edge_duration = node_duration + facade.GetDurationPenaltyForEdgeID(turn_id);
|
const auto edge_duration = node_duration + facade.GetDurationPenaltyForEdgeID(turn_id);
|
||||||
|
|
||||||
@ -299,7 +301,6 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check a single path result and insert adjacent nodes into heap
|
|
||||||
auto insert_node = [&](NodeID node, EdgeWeight initial_weight, EdgeDuration initial_duration) {
|
auto insert_node = [&](NodeID node, EdgeWeight initial_weight, EdgeDuration initial_duration) {
|
||||||
|
|
||||||
// Update single node paths
|
// Update single node paths
|
||||||
@ -311,9 +312,19 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
const auto &data = facade.GetEdgeData(edge);
|
const auto &data = facade.GetEdgeData(edge);
|
||||||
if (DIRECTION == FORWARD_DIRECTION ? data.forward : data.backward)
|
if (DIRECTION == FORWARD_DIRECTION ? data.forward : data.backward)
|
||||||
{
|
{
|
||||||
query_heap.Insert(facade.GetTarget(edge),
|
const auto turn_id = data.turn_id;
|
||||||
data.weight + initial_weight,
|
const auto edge_weight =
|
||||||
{node, data.duration + initial_duration});
|
initial_weight +
|
||||||
|
facade.GetNodeWeight(DIRECTION == FORWARD_DIRECTION ? node
|
||||||
|
: facade.GetTarget(edge)) +
|
||||||
|
facade.GetWeightPenaltyForEdgeID(turn_id);
|
||||||
|
const auto edge_duration = initial_duration +
|
||||||
|
+facade.GetNodeDuration(DIRECTION == FORWARD_DIRECTION
|
||||||
|
? node
|
||||||
|
: facade.GetTarget(edge)) +
|
||||||
|
facade.GetDurationPenaltyForEdgeID(turn_id);
|
||||||
|
|
||||||
|
query_heap.Insert(facade.GetTarget(edge), edge_weight, {node, edge_duration});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -107,6 +107,13 @@ void EdgeBasedGraphFactory::GetEdgeBasedNodeWeights(std::vector<EdgeWeight> &out
|
|||||||
swap(m_edge_based_node_weights, output_node_weights);
|
swap(m_edge_based_node_weights, output_node_weights);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EdgeBasedGraphFactory::GetEdgeBasedNodeDurations(
|
||||||
|
std::vector<EdgeWeight> &output_node_durations)
|
||||||
|
{
|
||||||
|
using std::swap; // Koenig swap
|
||||||
|
swap(m_edge_based_node_durations, output_node_durations);
|
||||||
|
}
|
||||||
|
|
||||||
std::uint32_t EdgeBasedGraphFactory::GetConnectivityChecksum() const
|
std::uint32_t EdgeBasedGraphFactory::GetConnectivityChecksum() const
|
||||||
{
|
{
|
||||||
return m_connectivity_checksum;
|
return m_connectivity_checksum;
|
||||||
@ -281,6 +288,7 @@ unsigned EdgeBasedGraphFactory::LabelEdgeBasedNodes()
|
|||||||
// heuristic: node-based graph node is a simple intersection with four edges
|
// heuristic: node-based graph node is a simple intersection with four edges
|
||||||
// (edge-based nodes)
|
// (edge-based nodes)
|
||||||
m_edge_based_node_weights.reserve(4 * m_node_based_graph.GetNumberOfNodes());
|
m_edge_based_node_weights.reserve(4 * m_node_based_graph.GetNumberOfNodes());
|
||||||
|
m_edge_based_node_durations.reserve(4 * m_node_based_graph.GetNumberOfNodes());
|
||||||
nbe_to_ebn_mapping.resize(m_node_based_graph.GetEdgeCapacity(), SPECIAL_NODEID);
|
nbe_to_ebn_mapping.resize(m_node_based_graph.GetEdgeCapacity(), SPECIAL_NODEID);
|
||||||
|
|
||||||
// renumber edge based node of outgoing edges
|
// renumber edge based node of outgoing edges
|
||||||
@ -297,6 +305,7 @@ unsigned EdgeBasedGraphFactory::LabelEdgeBasedNodes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_edge_based_node_weights.push_back(edge_data.weight);
|
m_edge_based_node_weights.push_back(edge_data.weight);
|
||||||
|
m_edge_based_node_durations.push_back(edge_data.duration);
|
||||||
|
|
||||||
BOOST_ASSERT(numbered_edges_count < m_node_based_graph.GetNumberOfEdges());
|
BOOST_ASSERT(numbered_edges_count < m_node_based_graph.GetNumberOfEdges());
|
||||||
nbe_to_ebn_mapping[current_edge] = numbered_edges_count;
|
nbe_to_ebn_mapping[current_edge] = numbered_edges_count;
|
||||||
@ -392,6 +401,8 @@ EdgeBasedGraphFactory::GenerateEdgeExpandedNodes(const WayRestrictionMap &way_re
|
|||||||
const auto ebn_weight = m_edge_based_node_weights[nbe_to_ebn_mapping[eid]];
|
const auto ebn_weight = m_edge_based_node_weights[nbe_to_ebn_mapping[eid]];
|
||||||
BOOST_ASSERT(ebn_weight == INVALID_EDGE_WEIGHT || ebn_weight == edge_data.weight);
|
BOOST_ASSERT(ebn_weight == INVALID_EDGE_WEIGHT || ebn_weight == edge_data.weight);
|
||||||
m_edge_based_node_weights.push_back(ebn_weight);
|
m_edge_based_node_weights.push_back(ebn_weight);
|
||||||
|
m_edge_based_node_durations.push_back(
|
||||||
|
m_edge_based_node_durations[nbe_to_ebn_mapping[eid]]);
|
||||||
|
|
||||||
edge_based_node_id++;
|
edge_based_node_id++;
|
||||||
progress.PrintStatus(progress_counter++);
|
progress.PrintStatus(progress_counter++);
|
||||||
@ -400,6 +411,7 @@ EdgeBasedGraphFactory::GenerateEdgeExpandedNodes(const WayRestrictionMap &way_re
|
|||||||
|
|
||||||
BOOST_ASSERT(m_edge_based_node_segments.size() == m_edge_based_node_is_startpoint.size());
|
BOOST_ASSERT(m_edge_based_node_segments.size() == m_edge_based_node_is_startpoint.size());
|
||||||
BOOST_ASSERT(m_number_of_edge_based_nodes == m_edge_based_node_weights.size());
|
BOOST_ASSERT(m_number_of_edge_based_nodes == m_edge_based_node_weights.size());
|
||||||
|
BOOST_ASSERT(m_number_of_edge_based_nodes == m_edge_based_node_durations.size());
|
||||||
|
|
||||||
util::Log() << "Generated " << m_number_of_edge_based_nodes << " nodes ("
|
util::Log() << "Generated " << m_number_of_edge_based_nodes << " nodes ("
|
||||||
<< way_restriction_map.NumberOfDuplicatedNodes()
|
<< way_restriction_map.NumberOfDuplicatedNodes()
|
||||||
|
@ -241,6 +241,7 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
|
|||||||
util::DeallocatingVector<EdgeBasedEdge> edge_based_edge_list;
|
util::DeallocatingVector<EdgeBasedEdge> edge_based_edge_list;
|
||||||
std::vector<bool> node_is_startpoint;
|
std::vector<bool> node_is_startpoint;
|
||||||
std::vector<EdgeWeight> edge_based_node_weights;
|
std::vector<EdgeWeight> edge_based_node_weights;
|
||||||
|
std::vector<EdgeDuration> edge_based_node_durations;
|
||||||
std::uint32_t ebg_connectivity_checksum = 0;
|
std::uint32_t ebg_connectivity_checksum = 0;
|
||||||
|
|
||||||
// Create a node-based graph from the OSRM file
|
// Create a node-based graph from the OSRM file
|
||||||
@ -320,6 +321,7 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
|
|||||||
edge_based_node_segments,
|
edge_based_node_segments,
|
||||||
node_is_startpoint,
|
node_is_startpoint,
|
||||||
edge_based_node_weights,
|
edge_based_node_weights,
|
||||||
|
edge_based_node_durations,
|
||||||
edge_based_edge_list,
|
edge_based_edge_list,
|
||||||
ebg_connectivity_checksum);
|
ebg_connectivity_checksum);
|
||||||
|
|
||||||
@ -343,8 +345,8 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
|
|||||||
|
|
||||||
util::Log() << "Saving edge-based node weights to file.";
|
util::Log() << "Saving edge-based node weights to file.";
|
||||||
TIMER_START(timer_write_node_weights);
|
TIMER_START(timer_write_node_weights);
|
||||||
extractor::files::writeEdgeBasedNodeWeights(config.GetPath(".osrm.enw"),
|
extractor::files::writeEdgeBasedNodeWeightsDurations(
|
||||||
edge_based_node_weights);
|
config.GetPath(".osrm.enw"), edge_based_node_weights, edge_based_node_durations);
|
||||||
TIMER_STOP(timer_write_node_weights);
|
TIMER_STOP(timer_write_node_weights);
|
||||||
util::Log() << "Done writing. (" << TIMER_SEC(timer_write_node_weights) << ")";
|
util::Log() << "Done writing. (" << TIMER_SEC(timer_write_node_weights) << ")";
|
||||||
|
|
||||||
@ -733,6 +735,7 @@ EdgeID Extractor::BuildEdgeExpandedGraph(
|
|||||||
std::vector<EdgeBasedNodeSegment> &edge_based_node_segments,
|
std::vector<EdgeBasedNodeSegment> &edge_based_node_segments,
|
||||||
std::vector<bool> &node_is_startpoint,
|
std::vector<bool> &node_is_startpoint,
|
||||||
std::vector<EdgeWeight> &edge_based_node_weights,
|
std::vector<EdgeWeight> &edge_based_node_weights,
|
||||||
|
std::vector<EdgeDuration> &edge_based_node_durations,
|
||||||
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
util::DeallocatingVector<EdgeBasedEdge> &edge_based_edge_list,
|
||||||
std::uint32_t &connectivity_checksum)
|
std::uint32_t &connectivity_checksum)
|
||||||
{
|
{
|
||||||
@ -782,6 +785,7 @@ EdgeID Extractor::BuildEdgeExpandedGraph(
|
|||||||
edge_based_graph_factory.GetEdgeBasedNodeSegments(edge_based_node_segments);
|
edge_based_graph_factory.GetEdgeBasedNodeSegments(edge_based_node_segments);
|
||||||
edge_based_graph_factory.GetStartPointMarkers(node_is_startpoint);
|
edge_based_graph_factory.GetStartPointMarkers(node_is_startpoint);
|
||||||
edge_based_graph_factory.GetEdgeBasedNodeWeights(edge_based_node_weights);
|
edge_based_graph_factory.GetEdgeBasedNodeWeights(edge_based_node_weights);
|
||||||
|
edge_based_graph_factory.GetEdgeBasedNodeDurations(edge_based_node_durations);
|
||||||
connectivity_checksum = edge_based_graph_factory.GetConnectivityChecksum();
|
connectivity_checksum = edge_based_graph_factory.GetConnectivityChecksum();
|
||||||
|
|
||||||
return number_of_edge_based_nodes;
|
return number_of_edge_based_nodes;
|
||||||
|
@ -146,9 +146,13 @@ int Partitioner::Run(const PartitionerConfig &config)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::vector<EdgeWeight> node_weights;
|
std::vector<EdgeWeight> node_weights;
|
||||||
extractor::files::readEdgeBasedNodeWeights(config.GetPath(".osrm.enw"), node_weights);
|
std::vector<EdgeDuration> node_durations;
|
||||||
|
extractor::files::readEdgeBasedNodeWeightsDurations(
|
||||||
|
config.GetPath(".osrm.enw"), node_weights, node_durations);
|
||||||
util::inplacePermutation(node_weights.begin(), node_weights.end(), permutation);
|
util::inplacePermutation(node_weights.begin(), node_weights.end(), permutation);
|
||||||
extractor::files::writeEdgeBasedNodeWeights(config.GetPath(".osrm.enw"), node_weights);
|
util::inplacePermutation(node_durations.begin(), node_durations.end(), permutation);
|
||||||
|
extractor::files::writeEdgeBasedNodeWeightsDurations(
|
||||||
|
config.GetPath(".osrm.enw"), node_weights, node_durations);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const auto &filename = config.GetPath(".osrm.maneuver_overrides");
|
const auto &filename = config.GetPath(".osrm.maneuver_overrides");
|
||||||
|
@ -529,6 +529,17 @@ EdgeID
|
|||||||
Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
std::vector<EdgeWeight> &node_weights,
|
std::vector<EdgeWeight> &node_weights,
|
||||||
std::uint32_t &connectivity_checksum) const
|
std::uint32_t &connectivity_checksum) const
|
||||||
|
{
|
||||||
|
std::vector<EdgeDuration> node_durations(node_weights.size());
|
||||||
|
return LoadAndUpdateEdgeExpandedGraph(
|
||||||
|
edge_based_edge_list, node_weights, node_durations, connectivity_checksum);
|
||||||
|
}
|
||||||
|
|
||||||
|
EdgeID
|
||||||
|
Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
|
std::vector<EdgeWeight> &node_weights,
|
||||||
|
std::vector<EdgeDuration> &node_durations,
|
||||||
|
std::uint32_t &connectivity_checksum) const
|
||||||
{
|
{
|
||||||
TIMER_START(load_edges);
|
TIMER_START(load_edges);
|
||||||
|
|
||||||
@ -536,7 +547,8 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
|
|||||||
std::vector<util::Coordinate> coordinates;
|
std::vector<util::Coordinate> coordinates;
|
||||||
extractor::PackedOSMIDs osm_node_ids;
|
extractor::PackedOSMIDs osm_node_ids;
|
||||||
|
|
||||||
extractor::files::readEdgeBasedNodeWeights(config.GetPath(".osrm.enw"), node_weights);
|
extractor::files::readEdgeBasedNodeWeightsDurations(
|
||||||
|
config.GetPath(".osrm.enw"), node_weights, node_durations);
|
||||||
|
|
||||||
extractor::files::readEdgeBasedGraph(config.GetPath(".osrm.ebg"),
|
extractor::files::readEdgeBasedGraph(config.GetPath(".osrm.ebg"),
|
||||||
number_of_edge_based_nodes,
|
number_of_edge_based_nodes,
|
||||||
@ -738,6 +750,7 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
|
|||||||
BOOST_ASSERT(edge.source < node_weights.size());
|
BOOST_ASSERT(edge.source < node_weights.size());
|
||||||
node_weights[edge.source] =
|
node_weights[edge.source] =
|
||||||
node_weights[edge.source] & 0x80000000 ? new_weight | 0x80000000 : new_weight;
|
node_weights[edge.source] & 0x80000000 ? new_weight | 0x80000000 : new_weight;
|
||||||
|
node_durations[edge.source] = new_duration;
|
||||||
|
|
||||||
// We found a zero-speed edge, so we'll skip this whole edge-based-edge
|
// We found a zero-speed edge, so we'll skip this whole edge-based-edge
|
||||||
// which
|
// which
|
||||||
|
Loading…
Reference in New Issue
Block a user