Fix remaining PR comments
This commit is contained in:
parent
00e243b23b
commit
bc8617a9f4
@ -37,7 +37,7 @@ class CellCustomizer
|
||||
const std::vector<bool> &allowed_nodes,
|
||||
CellMetric &metric,
|
||||
LevelID level,
|
||||
CellID id)
|
||||
CellID id) const
|
||||
{
|
||||
auto cell = cells.GetCell(metric, level, id);
|
||||
auto destinations = cell.GetDestinationNodes();
|
||||
@ -98,7 +98,7 @@ class CellCustomizer
|
||||
void Customize(const GraphT &graph,
|
||||
const partition::CellStorage &cells,
|
||||
const std::vector<bool> &allowed_nodes,
|
||||
CellMetric &metric)
|
||||
CellMetric &metric) const
|
||||
{
|
||||
Heap heap_exemplar(graph.GetNumberOfNodes());
|
||||
HeapPtr heaps(heap_exemplar);
|
||||
|
@ -338,8 +338,8 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
||||
}
|
||||
|
||||
const auto &last_cell = cells.back();
|
||||
ValueOffset total_size = cells.back().value_offset +
|
||||
last_cell.num_source_nodes * last_cell.num_destination_nodes;
|
||||
ValueOffset total_size =
|
||||
last_cell.value_offset + last_cell.num_source_nodes * last_cell.num_destination_nodes;
|
||||
|
||||
metric.weights.resize(total_size + 1, INVALID_EDGE_WEIGHT);
|
||||
metric.durations.resize(total_size + 1, MAXIMAL_EDGE_DURATION);
|
||||
|
@ -19,12 +19,12 @@ function setup()
|
||||
use_turn_restrictions = true
|
||||
},
|
||||
|
||||
classes = {[0] = "motorway", [1] = "toll", [2] = "TooWords2"},
|
||||
classes = {"motorway", "toll", "TooWords2"},
|
||||
|
||||
excludable = {
|
||||
[1] = {["motorway"] = true},
|
||||
[2] = {["toll"] = true},
|
||||
[3] = {["motorway"] = true, ["toll"] = true}
|
||||
{["motorway"] = true},
|
||||
{["toll"] = true},
|
||||
{["motorway"] = true, ["toll"] = true}
|
||||
},
|
||||
|
||||
default_speed = 24,
|
||||
|
@ -22,6 +22,8 @@ namespace osrm
|
||||
namespace customizer
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename Graph, typename Partition, typename CellStorage>
|
||||
void CellStorageStatistics(const Graph &graph,
|
||||
const Partition &partition,
|
||||
@ -113,12 +115,11 @@ excludeFlagsToNodeFilter(const MultiLevelEdgeBasedGraph &graph,
|
||||
return filters;
|
||||
}
|
||||
|
||||
std::vector<CellMetric> filterToMetrics(const MultiLevelEdgeBasedGraph &graph,
|
||||
const partition::CellStorage &storage,
|
||||
const partition::MultiLevelPartition &mlp,
|
||||
const std::vector<std::vector<bool>> &node_filters)
|
||||
std::vector<CellMetric> customizeFilteredMetrics(const MultiLevelEdgeBasedGraph &graph,
|
||||
const partition::CellStorage &storage,
|
||||
const CellCustomizer &customizer,
|
||||
const std::vector<std::vector<bool>> &node_filters)
|
||||
{
|
||||
CellCustomizer customizer(mlp);
|
||||
std::vector<CellMetric> metrics;
|
||||
|
||||
for (auto filter : node_filters)
|
||||
@ -130,6 +131,7 @@ std::vector<CellMetric> filterToMetrics(const MultiLevelEdgeBasedGraph &graph,
|
||||
|
||||
return metrics;
|
||||
}
|
||||
}
|
||||
|
||||
int Customizer::Run(const CustomizationConfig &config)
|
||||
{
|
||||
@ -156,7 +158,7 @@ int Customizer::Run(const CustomizationConfig &config)
|
||||
|
||||
TIMER_START(cell_customize);
|
||||
auto filter = excludeFlagsToNodeFilter(graph, node_data, properties);
|
||||
auto metrics = filterToMetrics(graph, storage, mlp, filter);
|
||||
auto metrics = customizeFilteredMetrics(graph, storage, CellCustomizer{mlp}, filter);
|
||||
TIMER_STOP(cell_customize);
|
||||
util::Log() << "Cells customization took " << TIMER_SEC(cell_customize) << " seconds";
|
||||
|
||||
|
@ -82,8 +82,7 @@ void SetClassNames(const std::vector<std::string> &class_names,
|
||||
{
|
||||
if (!isValidClassName(name))
|
||||
{
|
||||
throw util::exception("Invalid class name " + name +
|
||||
" only [a-Z0-9] allowed.");
|
||||
throw util::exception("Invalid class name " + name + " only [a-Z0-9] allowed.");
|
||||
}
|
||||
|
||||
auto iter = classes_map.find(name);
|
||||
|
Loading…
Reference in New Issue
Block a user