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
+6 -11
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);
}
}
}
+7 -11
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);
+1 -1
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());
-5
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),
+2 -2
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;