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

Method AddBearingPenalty

tools/openlr/router.cpp:55–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void Router::Vertex::Score::AddBearingPenalty(int expected, int actual)
56{
57 ASSERT_LESS(expected, kNumBuckets, ());
58 ASSERT_GREATER_OR_EQUAL(expected, 0, ());
59
60 ASSERT_LESS(actual, kNumBuckets, ());
61 ASSERT_GREATER_OR_EQUAL(actual, 0, ());
62
63 int const diff = abs(expected - actual);
64 double angle = math::DegToRad(std::min(diff, kNumBuckets - diff) * kAnglesInBucket);
65 m_penalty += kBearingErrorCoeff * angle * kBearingDist;
66}
67
68bool Router::Vertex::Score::operator<(Score const & rhs) const
69{

Callers 1

FindPathMethod · 0.80

Calls 1

DegToRadFunction · 0.85

Tested by

no test coverage detected