Draft: re-use forward heap in map matching
This commit is contained in:
parent
298a8e4d2f
commit
45f64e672f
@ -701,9 +701,10 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
const PhantomNode &target_phantom,
|
const PhantomNode &target_phantom,
|
||||||
EdgeWeight weight_upper_bound = INVALID_EDGE_WEIGHT)
|
EdgeWeight weight_upper_bound = INVALID_EDGE_WEIGHT)
|
||||||
{
|
{
|
||||||
forward_heap.Clear();
|
|
||||||
reverse_heap.Clear();
|
reverse_heap.Clear();
|
||||||
|
|
||||||
|
if (forward_heap.Empty())
|
||||||
|
{
|
||||||
if (source_phantom.IsValidForwardSource())
|
if (source_phantom.IsValidForwardSource())
|
||||||
{
|
{
|
||||||
forward_heap.Insert(source_phantom.forward_segment_id.id,
|
forward_heap.Insert(source_phantom.forward_segment_id.id,
|
||||||
@ -721,6 +722,7 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
false,
|
false,
|
||||||
EdgeDistance{0} - source_phantom.GetReverseDistance()});
|
EdgeDistance{0} - source_phantom.GetReverseDistance()});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (target_phantom.IsValidForwardTarget())
|
if (target_phantom.IsValidForwardTarget())
|
||||||
{
|
{
|
||||||
|
@ -225,6 +225,8 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forward_heap.Clear();
|
||||||
|
|
||||||
for (const auto s_prime : util::irange<std::size_t>(0UL, current_viterbi.size()))
|
for (const auto s_prime : util::irange<std::size_t>(0UL, current_viterbi.size()))
|
||||||
{
|
{
|
||||||
const double emission_pr = emission_log_probabilities[t][s_prime];
|
const double emission_pr = emission_log_probabilities[t][s_prime];
|
||||||
@ -264,6 +266,8 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
model.breakage[t] = false;
|
model.breakage[t] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forward_heap.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.breakage[t])
|
if (model.breakage[t])
|
||||||
|
Loading…
Reference in New Issue
Block a user