From 0df50f44ec86c420ef8b2d0ce0b4725818a95b92 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Tue, 27 Mar 2018 11:44:49 +0300 Subject: Using double for m_transitTime. --- routing/route_weight.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'routing') diff --git a/routing/route_weight.hpp b/routing/route_weight.hpp index b5a83ac1d4..aedb731dba 100644 --- a/routing/route_weight.hpp +++ b/routing/route_weight.hpp @@ -22,7 +22,7 @@ public: : m_weight(weight) , m_numPassThroughChanges(static_cast(numPassThroughChanges)) , m_numAccessChanges(static_cast(numAccessChanges)) - , m_transitTime(static_cast(transitTime)) + , m_transitTime(transitTime) { } @@ -32,7 +32,7 @@ public: double GetWeight() const { return m_weight; } int8_t GetNumPassThroughChanges() const { return m_numPassThroughChanges; } int8_t GetNumAccessChanges() const { return m_numAccessChanges; } - double GetTransitTime() const { return static_cast(m_transitTime); } + double GetTransitTime() const { return m_transitTime; } bool operator<(RouteWeight const & rhs) const { @@ -48,7 +48,7 @@ public: return m_numAccessChanges < rhs.m_numAccessChanges; if (m_weight != rhs.m_weight) return m_weight < rhs.m_weight; - // Preffer bigger transit time if total weights are same. + // Prefer bigger transit time if total weights are same. return m_transitTime > rhs.m_transitTime; } @@ -80,7 +80,7 @@ public: return m_numPassThroughChanges == rhs.m_numPassThroughChanges && m_numAccessChanges == rhs.m_numAccessChanges && my::AlmostEqualAbs(m_weight, rhs.m_weight, epsilon) && - my::AlmostEqualAbs(m_transitTime, rhs.m_transitTime, static_cast(epsilon)); + my::AlmostEqualAbs(m_transitTime, rhs.m_transitTime, epsilon); } private: @@ -91,7 +91,7 @@ private: // Number of access=yes/access={private,destination} zone changes. int8_t m_numAccessChanges = 0; // Transit time. It's already included in |m_weight| (m_transitTime <= m_weight). - float m_transitTime = 0.0F; + double m_transitTime = 0.0F; }; std::ostream & operator<<(std::ostream & os, RouteWeight const & routeWeight); @@ -101,7 +101,7 @@ RouteWeight operator*(double lhs, RouteWeight const & rhs); template <> constexpr RouteWeight GetAStarWeightMax() { - return RouteWeight(std::numeric_limits::max() /* weight */, + return RouteWeight(std::numeric_limits::max() /* weight */, std::numeric_limits::max() /* numPassThroughChanges */, std::numeric_limits::max() /* numAccessChanges */, 0.0 /* transitTime */); // operator< prefers bigger transit time -- cgit v1.2.3