Skip to content

Commit

Permalink
add try catch and make it static
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-no committed Nov 17, 2023
1 parent b0163ab commit ab200cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/baldr/graphtile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ void GraphTile::Initialize(const GraphId& graphid) {
} else {
lane_connectivity_size_ = header_->end_offset() - header_->lane_connectivity_offset();
}

/*
try {
live_speed_fading_sec_ = config().get<float>("baldr.live_speed_fading_sec", 3600);
} catch (const ConfigUninitializedException& e) { live_speed_fading_sec_ = 3600; }

*/
// For reference - how to use the end offset to set size of an object (that
// is not fixed size and count).
// example_size_ = header_->end_offset() - header_->example_offset();
Expand Down
6 changes: 5 additions & 1 deletion valhalla/baldr/graphtile.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,9 @@ class GraphTile {
// TODO(danpat): for short-ish durations along the route, we should fade live
// speeds into any historic/predictive/average value we'd normally use

double live_speed_fade = 1. / live_speed_fading_sec_;
try {
static double live_speed_fade = 1. / config().get<float>("baldr.live_speed_fading_sec", 3600);
} catch (const ConfigUninitializedException& e) { static double live_speed_fade = 1. / 3600; }

// This parameter describes the weight of live-traffic on a specific edge. In the beginning of the
// route live-traffic gives more information about current congestion situation. But the further
Expand Down Expand Up @@ -886,8 +888,10 @@ class GraphTile {
// Predicted speeds
PredictedSpeeds predictedspeeds_;

/*
// Time (in seconds) over which live speed will be faded into other traffic speed sources
float live_speed_fading_sec_;
*/

// Map of stop one stops in this tile.
std::unordered_map<std::string, GraphId> stop_one_stops;
Expand Down

0 comments on commit ab200cb

Please sign in to comment.