MCPcopy Create free account
hub / github.com/comaps/comaps / UpdateProgress

Method UpdateProgress

libs/routing/base/astar_progress.cpp:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39double AStarSubProgress::UpdateProgress(ms::LatLon const & current, ms::LatLon const & finish)
40{
41 // to avoid 0/0
42 if (m_fullDistance < kMwmPointAccuracy)
43 return m_currentProgress;
44
45 double const dist = CalcDistance(current, finish);
46 double & toUpdate = finish == m_finishPoint ? m_forwardDistance : m_backwardDistance;
47
48 toUpdate = std::min(toUpdate, dist);
49
50 double part = 2.0 - (m_forwardDistance + m_backwardDistance) / m_fullDistance;
51 part = math::Clamp(part, 0.0, 1.0);
52 double const newProgress = m_contributionCoef * part;
53
54 m_currentProgress = std::max(newProgress, m_currentProgress);
55 return m_currentProgress;
56}
57
58double AStarSubProgress::UpdateProgress(double subSubProgressValue)
59{

Callers 3

operator()Method · 0.80
UpdateProgressImplMethod · 0.80
UNIT_TESTFunction · 0.80

Calls 4

ClampFunction · 0.85
ASSERTFunction · 0.85
AlmostEqualAbsFunction · 0.50
beginMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64