Do not take the current route into account in alternatives_count parameter.

This commit is contained in:
Lev Dragunov
2017-02-06 13:40:41 +03:00
committed by Patrick Niklaus
parent 421d336b0f
commit 07221f5a48
3 changed files with 7 additions and 4 deletions
@@ -371,10 +371,13 @@ operator()(const std::shared_ptr<const datafacade::BaseDataFacade> facade,
matching.indices.push_back(timestamp_index);
matching.nodes.push_back(candidates_list[timestamp_index][location_index].phantom_node);
matching.alternatives_count.push_back(
auto const routes_count =
std::accumulate(model.viterbi_reachable[timestamp_index].begin(),
model.viterbi_reachable[timestamp_index].end(),
0));
0);
BOOST_ASSERT(routes_count > 0);
// we don't count the current route in the "alternatives_count" parameter
matching.alternatives_count.push_back(routes_count - 1);
matching_distance += model.path_distances[timestamp_index][location_index];
}
util::for_each_pair(