2017-01-23 05:50:03 -05:00
|
|
|
#ifndef PARTITIONER_CONFIG_HPP
|
|
|
|
#define PARTITIONER_CONFIG_HPP
|
|
|
|
|
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace partition
|
|
|
|
{
|
|
|
|
|
|
|
|
struct PartitionConfig
|
|
|
|
{
|
2017-03-27 06:17:01 -04:00
|
|
|
PartitionConfig()
|
|
|
|
: requested_num_threads(0), balance(1.2), boundary_factor(0.25), num_optimizing_cuts(10),
|
|
|
|
small_component_size(1000),
|
|
|
|
max_cell_sizes{128, 128 * 32, 128 * 32 * 16, 128 * 32 * 16 * 32}
|
|
|
|
{
|
|
|
|
}
|
2017-01-23 05:50:03 -05:00
|
|
|
|
|
|
|
void UseDefaults()
|
|
|
|
{
|
|
|
|
std::string basepath = base_path.string();
|
|
|
|
|
|
|
|
const std::string ext = ".osrm";
|
|
|
|
const auto pos = basepath.find(ext);
|
|
|
|
if (pos != std::string::npos)
|
|
|
|
{
|
|
|
|
basepath.replace(pos, ext.size(), "");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// unknown extension
|
|
|
|
}
|
|
|
|
|
|
|
|
edge_based_graph_path = basepath + ".osrm.ebg";
|
2017-01-26 11:53:19 -05:00
|
|
|
compressed_node_based_graph_path = basepath + ".osrm.cnbg";
|
2017-02-28 20:02:58 -05:00
|
|
|
cnbg_ebg_mapping_path = basepath + ".osrm.cnbg_to_ebg";
|
2017-05-19 18:28:01 -04:00
|
|
|
file_index_path = basepath + ".osrm.fileIndex";
|
2017-01-23 05:50:03 -05:00
|
|
|
partition_path = basepath + ".osrm.partition";
|
2017-05-19 18:28:01 -04:00
|
|
|
storage_path = basepath + ".osrm.cells";
|
|
|
|
node_data_path = basepath + ".osrm.ebg_nodes";
|
|
|
|
hsgr_path = basepath + ".osrm.hsgr";
|
2017-01-23 05:50:03 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// might be changed to the node based graph at some point
|
|
|
|
boost::filesystem::path base_path;
|
|
|
|
boost::filesystem::path edge_based_graph_path;
|
2017-01-26 11:53:19 -05:00
|
|
|
boost::filesystem::path compressed_node_based_graph_path;
|
2017-02-28 20:02:58 -05:00
|
|
|
boost::filesystem::path cnbg_ebg_mapping_path;
|
2017-01-23 05:50:03 -05:00
|
|
|
boost::filesystem::path partition_path;
|
2017-05-19 18:28:01 -04:00
|
|
|
boost::filesystem::path file_index_path;
|
|
|
|
boost::filesystem::path storage_path;
|
|
|
|
boost::filesystem::path node_data_path;
|
|
|
|
boost::filesystem::path hsgr_path;
|
2017-01-23 05:50:03 -05:00
|
|
|
|
|
|
|
unsigned requested_num_threads;
|
2017-01-26 11:53:19 -05:00
|
|
|
|
|
|
|
double balance;
|
|
|
|
double boundary_factor;
|
|
|
|
std::size_t num_optimizing_cuts;
|
2017-02-02 09:53:42 -05:00
|
|
|
std::size_t small_component_size;
|
2017-03-27 06:17:01 -04:00
|
|
|
std::vector<std::size_t> max_cell_sizes;
|
2017-01-23 05:50:03 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // PARTITIONER_CONFIG_HPP
|