Fix help texts and .nbg_to_ebg -> .cnbg_to_ebg

This commit is contained in:
Patrick Niklaus 2017-03-01 01:02:58 +00:00 committed by Patrick Niklaus
parent e20cbf673f
commit 886421b43a
8 changed files with 24 additions and 43 deletions

View File

@ -114,9 +114,8 @@ class EdgeBasedGraphFactory
const std::string &turn_weight_penalties_filename,
const std::string &turn_duration_penalties_filename,
const std::string &turn_penalties_index_filename,
const bool generate_edge_lookup,
const bool generate_nbg_ebg_mapping,
const std::string &nbg_ebg_mapping_path);
const std::string &cnbg_ebg_mapping_path,
const bool generate_edge_lookup);
// The following get access functions destroy the content in the factory
void GetEdgeBasedEdges(util::DeallocatingVector<EdgeBasedEdge> &edges);
@ -176,8 +175,7 @@ class EdgeBasedGraphFactory
unsigned RenumberEdges();
void GenerateEdgeExpandedNodes(const bool generate_nbg_ebg_mapping,
const std::string &nbg_ebg_mapping_path);
void GenerateEdgeExpandedNodes(const std::string &nbg_ebg_mapping_path);
void GenerateEdgeExpandedEdges(ScriptingEnvironment &scripting_environment,
const std::string &original_edge_data_filename,

View File

@ -78,7 +78,7 @@ struct ExtractorConfig
profile_properties_output_path = basepath + ".osrm.properties";
intersection_class_data_output_path = basepath + ".osrm.icd";
compressed_node_based_graph_output_path = basepath + ".osrm.cnbg";
nbg_ebg_graph_mapping_output_path = basepath + ".osrm.nbg_to_ebg";
cnbg_ebg_graph_mapping_output_path = basepath + ".osrm.cnbg_to_ebg";
}
boost::filesystem::path input_path;
@ -101,6 +101,8 @@ struct ExtractorConfig
std::string intersection_class_data_output_path;
std::string turn_weight_penalties_path;
std::string turn_duration_penalties_path;
std::string compressed_node_based_graph_output_path;
std::string cnbg_ebg_graph_mapping_output_path;
unsigned requested_num_threads;
unsigned small_component_size;
@ -110,11 +112,6 @@ struct ExtractorConfig
std::string edge_segment_lookup_path;
bool use_metadata;
// Auxiliary data for osrm-partition
bool dump_compressed_node_based_graph;
std::string compressed_node_based_graph_output_path;
std::string nbg_ebg_graph_mapping_output_path;
};
}
}

View File

@ -32,7 +32,7 @@ struct PartitionConfig
edge_based_graph_path = basepath + ".osrm.ebg";
compressed_node_based_graph_path = basepath + ".osrm.cnbg";
nbg_ebg_mapping_path = basepath + ".osrm.nbg_to_ebg";
cnbg_ebg_mapping_path = basepath + ".osrm.cnbg_to_ebg";
partition_path = basepath + ".osrm.partition";
}
@ -40,7 +40,7 @@ struct PartitionConfig
boost::filesystem::path base_path;
boost::filesystem::path edge_based_graph_path;
boost::filesystem::path compressed_node_based_graph_path;
boost::filesystem::path nbg_ebg_mapping_path;
boost::filesystem::path cnbg_ebg_mapping_path;
boost::filesystem::path partition_path;
unsigned requested_num_threads;

View File

@ -196,9 +196,8 @@ void EdgeBasedGraphFactory::Run(ScriptingEnvironment &scripting_environment,
const std::string &turn_weight_penalties_filename,
const std::string &turn_duration_penalties_filename,
const std::string &turn_penalties_index_filename,
const bool generate_edge_lookup,
const bool generate_nbg_ebg_mapping,
const std::string &nbg_ebg_mapping_path)
const std::string &cnbg_ebg_mapping_path,
const bool generate_edge_lookup)
{
TIMER_START(renumber);
m_max_edge_id = RenumberEdges() - 1;
@ -206,7 +205,7 @@ void EdgeBasedGraphFactory::Run(ScriptingEnvironment &scripting_environment,
TIMER_START(generate_nodes);
m_edge_based_node_weights.reserve(m_max_edge_id + 1);
GenerateEdgeExpandedNodes(generate_nbg_ebg_mapping, nbg_ebg_mapping_path);
GenerateEdgeExpandedNodes(cnbg_ebg_mapping_path);
TIMER_STOP(generate_nodes);
TIMER_START(generate_edges);
@ -260,15 +259,12 @@ unsigned EdgeBasedGraphFactory::RenumberEdges()
}
/// Creates the nodes in the edge expanded graph from edges in the node-based graph.
void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes(const bool generate_nbg_ebg_mapping,
const std::string &nbg_ebg_mapping_path)
void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes(const std::string &cnbg_ebg_mapping_path)
{
// Optional writer, for writing out a mapping. Neither default ctor not boost::optional work
// with the underlying FileWriter, so hack around that limitation with a unique_ptr.
std::unique_ptr<NodeBasedGraphToEdgeBasedGraphMappingWriter> writer;
if (generate_nbg_ebg_mapping)
writer =
std::make_unique<NodeBasedGraphToEdgeBasedGraphMappingWriter>(nbg_ebg_mapping_path);
writer = std::make_unique<NodeBasedGraphToEdgeBasedGraphMappingWriter>(cnbg_ebg_mapping_path);
util::Log() << "Generating edge expanded nodes ... ";
{
@ -311,8 +307,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes(const bool generate_nbg_eb
mapping = InsertEdgeBasedNode(node_u, node_v);
}
if (generate_nbg_ebg_mapping)
writer->WriteMapping(mapping->u, mapping->v, mapping->head, mapping->tail);
writer->WriteMapping(mapping->u, mapping->v, mapping->head, mapping->tail);
}
}
}

View File

@ -484,9 +484,8 @@ Extractor::BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment,
config.turn_weight_penalties_path,
config.turn_duration_penalties_path,
config.turn_penalties_index_path,
config.generate_edge_lookup,
config.dump_compressed_node_based_graph,
config.nbg_ebg_graph_mapping_output_path);
config.cnbg_ebg_graph_mapping_output_path,
config.generate_edge_lookup);
// The osrm-partition tool requires the compressed node based graph with an embedding.
//
@ -505,14 +504,11 @@ Extractor::BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment,
compressed_node_based_graph_writing.wait();
};
if (config.dump_compressed_node_based_graph)
{
compressed_node_based_graph_writing = std::async(std::launch::async, [&] {
WriteCompressedNodeBasedGraph(config.compressed_node_based_graph_output_path,
*node_based_graph,
internal_to_external_node_map);
});
}
compressed_node_based_graph_writing = std::async(std::launch::async, [&] {
WriteCompressedNodeBasedGraph(config.compressed_node_based_graph_output_path,
*node_based_graph,
internal_to_external_node_map);
});
WriteTurnLaneData(config.turn_lane_descriptions_file_name);
compressed_edge_container.SerializeInternalVector(config.geometry_output_path);

View File

@ -144,7 +144,7 @@ int Partitioner::Run(const PartitionConfig &config)
// Then loads the edge based graph tanslates the partition and modifies it.
// For details see #3205
auto mapping = LoadNodeBasedGraphToEdgeBasedGraphMapping(config.nbg_ebg_mapping_path.string());
auto mapping = LoadNodeBasedGraphToEdgeBasedGraphMapping(config.cnbg_ebg_mapping_path.string());
util::Log() << "Loaded node based graph to edge based graph mapping";
auto edge_based_graph = LoadEdgeBasedGraph(config.edge_based_graph_path.string());

View File

@ -46,11 +46,6 @@ return_code parseArguments(int argc, char *argv[], extractor::ExtractorConfig &e
->implicit_value(true)
->default_value(false),
"Generate a lookup table for internal edge-expanded-edge IDs to OSM node pairs")(
"dump-partition-graph",
boost::program_options::bool_switch(&extractor_config.dump_compressed_node_based_graph)
->implicit_value(true)
->default_value(false),
"Generate a partitionable graph file (.cnbg) for use with osrm-partition")(
"small-component-size",
boost::program_options::value<unsigned int>(&extractor_config.small_component_size)
->default_value(1000),

View File

@ -60,7 +60,7 @@ return_code parseArguments(int argc, char *argv[], partition::PartitionConfig &p
("small-component-size",
boost::program_options::value<std::size_t>(&partition_config.small_component_size)
->default_value(1000),
"Number of cuts to use for optimizing a single bisection");
"Size threshold for small components.");
// hidden options, will be allowed on command line, but will not be
// shown to the user
@ -161,7 +161,7 @@ int main(int argc, char *argv[]) try
};
if (!check_file(partition_config.edge_based_graph_path) ||
!check_file(partition_config.nbg_ebg_mapping_path) ||
!check_file(partition_config.cnbg_ebg_mapping_path) ||
!check_file(partition_config.compressed_node_based_graph_path))
{
return EXIT_FAILURE;