yakra / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
0 stars 0 forks source link

Why not one Route::label_hash? #215

Open yakra opened 2 years ago

yakra commented 2 years ago

Separate pri_label_hash and alt_label_hash make sense so we can get Note: deprecated route name in userlogs. (Although, a single `std::unordered_map<std::string,std::pair<Route,bool>>` with the bool distinguishing primary/alt might do the trick.)*

But there's no such notification for AltLabels. Could one hash should be sufficient? Seems so, quickly looking at routeintegrity.cpp & mark*_route_segments.cpp. Should be able to greatly simplify the insertion process in route_integrity.

Thought experiment: What happen{s,ed} with duplicate labels 1 pri + 1 alt, WRT the "unused" set & everything else...

yakra commented 2 years ago

Going to only one label_hash saves only a tiny sliver of time. As in, 0.08s tops, 1 thread on lab3. It would remove an opportunity to easily implement a who-uses-what-alt-labels log.

Not sure how much we actually want one right now... • si404 got the "Equivalent waypoint labels mark zero distance traveled in line: " .log notice • mapcat got unusedaltlabels.log That takes care of the specific concerns they mentioned, but we may want one for other reasons at some point. So why not leave this ability in place, in case we may want to use it in the future.

Sure, I could use std::pair<Route,bool> as a mapped type, but result.first->second->first to get a `Route` from an insertion result? Yeesh...