mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
[traffic] Documentation and comment cleanup
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -583,11 +583,6 @@ double RoutingTraffDecoder::TraffEstimator::GetTurnPenalty(Purpose /* purpose */
|
|||||||
routing::RoadGeometry const & to_road,
|
routing::RoadGeometry const & to_road,
|
||||||
bool is_left_hand_traffic) const
|
bool is_left_hand_traffic) const
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* TODO determine if turn penalties make sense for the traffic decoder, else leave them out.
|
|
||||||
* `angle` seems to be in degrees, right is negative
|
|
||||||
* Turn is at the first or last point of the roads involved, compare points to find out.
|
|
||||||
*/
|
|
||||||
// Flip sign for left-hand traffic, so a positive angle always means a turn across traffic
|
// Flip sign for left-hand traffic, so a positive angle always means a turn across traffic
|
||||||
if (is_left_hand_traffic)
|
if (is_left_hand_traffic)
|
||||||
angle *= -1;
|
angle *= -1;
|
||||||
|
|||||||
@@ -317,6 +317,19 @@ public:
|
|||||||
double GetRoadRefPenalty(std::string & ref) const;
|
double GetRoadRefPenalty(std::string & ref) const;
|
||||||
|
|
||||||
double GetUTurnPenalty(Purpose /* purpose */) const override;
|
double GetUTurnPenalty(Purpose /* purpose */) const override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Determines the penalty factor for making a turn.
|
||||||
|
*
|
||||||
|
* The turn is at the first or last points of `from_road` and `to_road` and can be determined
|
||||||
|
* by comparing the endpoints of `from_road` and `to_road` for a match.
|
||||||
|
*
|
||||||
|
* @param purpose The purpose for which the penalty is calculated, ignored by this implementation
|
||||||
|
* @param angle The angle in degrees (negative values indicate a right turn)
|
||||||
|
* @param from_road The road (segment between two junctions) before the turn
|
||||||
|
* @param to_road The road (segment between two junctions) after the turn
|
||||||
|
* @param is_left_hand_traffic True for left-hand traffic, false for right-hand traffic
|
||||||
|
*/
|
||||||
double GetTurnPenalty(Purpose /* purpose */, double angle, routing::RoadGeometry const & from_road,
|
double GetTurnPenalty(Purpose /* purpose */, double angle, routing::RoadGeometry const & from_road,
|
||||||
routing::RoadGeometry const & to_road, bool is_left_hand_traffic = false) const override;
|
routing::RoadGeometry const & to_road, bool is_left_hand_traffic = false) const override;
|
||||||
double GetFerryLandingPenalty(Purpose /* purpose */) const override;
|
double GetFerryLandingPenalty(Purpose /* purpose */) const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user