You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Different ConnectedRoutes that can be combined #492
I forget my reasoning behind thinking hash tables would be involved. Need to review #338.
That said...
Is the end of a ConnectedRoute colocated?
If so, is a colocated point on a different ConnectedRoute in the same HighwaySystem?
If so, is it ConnectedRoute::first_point() or ConnectedRoute::last_point? (These functions don't exist yet, but are what they say on the tin. Piece of cake to implement.)
If so, does this ConnectedRoute have the same route + banner? (Will figure out what to do with groupName as I start to implement this & see what results I get.)
See what causes crashes when ITA split systems are uncommented.
0m38.489s 492-0.l0g
last debug text
518879: p=itacal.ra004@A2Rac
518880: &cr2=0
error
8: Could not parse itaa2_con.csv line: [itaa2;RA4;;Raccordo Autostradale di Reggio Calabria;itacal.ra004;], expected 5 fields, found 6
cause
ConnectedRoute construction failed, so itacal.ra004 was never assigned a con_route, staying NULL.
Attempts to dereference (either right away to call cr2->connected_rtes_line() for debug text or later to call cr2->roots[0]->con_beg()).
fix
Put an if () around ConnectedRoute* cr2 = p->route->con_route; only proceed if cr2 is valid.
1m44.646s 492-1.l0g
last debug text
1667918: ConnectedRoute (0): itaa2;RA4;;Raccordo Autostradale di Reggio Calabria;
error
8: Could not parse itaa2_con.csv line: [itaa2;RA4;;Raccordo Autostradale di Reggio Calabria;itacal.ra004;], expected 5 fields, found 6
cause
Invalid ConnectedRoute object was created, rather than destroyed once it became apparent construction could not succeed.
fix
ConnectedRoute ctor needs to do like the Route ctor does, and throw when it can't parse a line.
HighwaySystem ctor needs to catch, same way.
1m45.639s 492-2.l0g
last debug text
1699408: ConnectedRoute (0): itass2;SS106;Ter;;
error
11: No valid roots in itass2_con.csv line: itass2;SS106;Ter;;itacal.ss106ter
cause
Same as above.
fix
Also throw when no valid roots are found.
1m45.707s 492-3.l0g
last debug text
1703816: ConnectedRoute (3): itass2;SS259;;;itatos.ss258,itaemi.ss258mol,itatos.ss258raf
1703817: w=0
error
19: [Errno 2] No such file or directory: '/home/yakra/tm/HighwayData/data/ITA-TOS/itass2/itatos.ss258.wpt'
20: [Errno 2] No such file or directory: '/home/yakra/tm/HighwayData/data/ITA-TOS/itass2/itatos.ss258raf.wpt'
cause
No waypoints means Route::points.data was initialized to 0 and never allocated, so con_beg() returns NULL.
fix
Only proceed to checking w->colocated when w is nonzero.
2m2.857s 492-4.l0g
last debug text
1703816: ConnectedRoute (3): itass2;SS259;;;itatos.ss258,itaemi.ss258mol,itatos.ss258raf
1703817: w=0
1703818: w=0xffffffffffffff78
error
Same as above.
cause 0xffffffffffffff78 = -136, one sizeof(Waypoint) below 0. Route::points.back() returns NULL - 1 (Route::points.size - 1).
This in turn gets returned by Route::con_beg() and/or Route::con_beg().
fix
Use a ternary to set w to 0 if points.size == 0. The previous fix will then kick in.
If all goes well I can have it go live later today.
And as soon as I typed that out, I found that all has gone well!
Just finished fixing one last bug caused by missing .wpt files.
Activity
[-]Separate ConnectedRoutes that can be connected[/-][+]Separate ConnectedRoutes that can be combined[/+]yakra commentedon Mar 29, 2022
I forget my reasoning behind thinking hash tables would be involved. Need to review #338.
That said...
ConnectedRoute::first_point()orConnectedRoute::last_point?(These functions don't exist yet, but are what they say on the tin. Piece of cake to implement.)
(Will figure out what to do with groupName as I start to implement this & see what results I get.)
...Unless I'm missing something?
yakra commentedon Oct 18, 2024
b1726d8a8480b26b810fc3fd124983fe24c2711dAll 16 results:
deuby.b019wur;BY/BW;;;COMBINE_CON_RTES;deubw.b019@BY/BW
deusn.b093bor;SN/TH;;;COMBINE_CON_RTES;deuth.b093@SN/TH
frabfc.d005788;BFC/GES;;;COMBINE_CON_RTES;frages.d005788rup@BFC/GES
frabfc.d005788beu;BFC/GES;;;COMBINE_CON_RTES;frages.d005788ram@BFC/GES
frabfc.d005788beu;GES/BFC;;;COMBINE_CON_RTES;frages.d005788rup@GES/BFC
frages.d003708ren;GES/HDF;;;COMBINE_CON_RTES;frahdf.d003708@GES/HDF
frages.d005788;GES/BFC;;;COMBINE_CON_RTES;frabfc.d005788@GES/BFC
frages.d005788ram;GES/BFC;;;COMBINE_CON_RTES;frabfc.d005788cha@GES/BFC
frages.d098051ant;GES/HDF;;;COMBINE_CON_RTES;frahdf.d098051vie@GES/HDF
frages.d098051ver;GES/HDF;;;COMBINE_CON_RTES;frahdf.d098051@GES/HDF
frahdf.d003708;HDF/GES;;;COMBINE_CON_RTES;frages.d003708sev@HDF/GES
frahdf.d098051;HDF/GES;;;COMBINE_CON_RTES;frages.d098051ant@HDF/GES
frahdf.d098051vie;HDF/GES;;;COMBINE_CON_RTES;frages.d098051@HDF/GES
indmh.ka010;MH/KA;;;COMBINE_CON_RTES;indka.ka010@MH/KA
indmh.ka122;MH/KA;;;COMBINE_CON_RTES;indka.ka122@MH/KA
indtg.ka010;KA/TG;;;COMBINE_CON_RTES;indka.ka010@KA/TG
@michihdeu, do the ones in your regions all look like legitimate cases that could be combined? Any FPs?
ToDo:
See what causes crashes when ITA split systems are uncommented.
518879:
p=itacal.ra004@A2Rac518880:
&cr2=08:
Could not parse itaa2_con.csv line: [itaa2;RA4;;Raccordo Autostradale di Reggio Calabria;itacal.ra004;], expected 5 fields, found 6ConnectedRoute construction failed, so
itacal.ra004was never assigned acon_route, staying NULL.Attempts to dereference (either right away to call
cr2->connected_rtes_line()for debug text or later to callcr2->roots[0]->con_beg()).Put an
if ()aroundConnectedRoute* cr2 = p->route->con_route; only proceed ifcr2is valid.1667918:
ConnectedRoute (0): itaa2;RA4;;Raccordo Autostradale di Reggio Calabria;8:
Could not parse itaa2_con.csv line: [itaa2;RA4;;Raccordo Autostradale di Reggio Calabria;itacal.ra004;], expected 5 fields, found 6Invalid ConnectedRoute object was created, rather than destroyed once it became apparent construction could not succeed.
ConnectedRoute ctor needs to do like the Route ctor does, and throw when it can't parse a line.
HighwaySystem ctor needs to catch, same way.
1699408:
ConnectedRoute (0): itass2;SS106;Ter;;11:
No valid roots in itass2_con.csv line: itass2;SS106;Ter;;itacal.ss106terSame as above.
Also throw when no valid roots are found.
1703816:
ConnectedRoute (3): itass2;SS259;;;itatos.ss258,itaemi.ss258mol,itatos.ss258raf1703817:
w=019:
[Errno 2] No such file or directory: '/home/yakra/tm/HighwayData/data/ITA-TOS/itass2/itatos.ss258.wpt'20:
[Errno 2] No such file or directory: '/home/yakra/tm/HighwayData/data/ITA-TOS/itass2/itatos.ss258raf.wpt'No waypoints means
Route::points.datawas initialized to 0 and never allocated, socon_beg()returns NULL.Only proceed to checking
w->colocatedwhenwis nonzero.1703816:
ConnectedRoute (3): itass2;SS259;;;itatos.ss258,itaemi.ss258mol,itatos.ss258raf1703817:
w=01703818:
w=0xffffffffffffff78Same as above.
0xffffffffffffff78= -136, onesizeof(Waypoint)below 0.Route::points.back()returns NULL - 1 (Route::points.size- 1).This in turn gets returned by
Route::con_beg()and/orRoute::con_beg().Use a ternary to set
wto 0 ifpoints.size== 0. The previous fix will then kick in.GREAT SUCCESS
[-]Separate ConnectedRoutes that can be combined[/-][+]Different ConnectedRoutes that can be combined[/+]DEU/FRA fixes COMBINE_CON_RTES
michihdeu commentedon Oct 18, 2024
Fixed. No FP. Thanks @yakra for that great error check 😄
michihdeu commentedon Oct 18, 2024
Will this error check be live soon? I'd like to check that I didn't miss one....
yakra commentedon Oct 18, 2024
If all goes well I can have it go live later today.
And as soon as I typed that out, I found that all has gone well!
Just finished fixing one last bug caused by missing .wpt files.
yakra commentedon Oct 18, 2024
Leaving this 37-line monstrosity here in case I ever want to restore the debug text:
Now to make it more compact if not readable, and trim it back to what was in the draft commit + the actual bugfixes.
To diff logs:
yakra commentedon Oct 18, 2024
@michihdeu, what's your opinion on whether this should be red or blue on the datacheck page?
michihdeu commentedon Oct 18, 2024
It doesn't falsify user stats if they use 4-field entries. Blue. But if 6-field.... hm, red?
yakra commentedon Oct 18, 2024
For 6-field entries, it wouldn't falsify anything; it simply wouldn't allow the entry to be made.
COMBINE_CON_RTES (TravelMapping#492)
yakra commentedon Oct 18, 2024
I'm going with red, simply because that's what no-build in that part of the code gives us.
If later on we decide blue is better, we can do that.
COMBINE_CON_RTES (TravelMapping#492)
Route::create_label_hashes()
COMBINE_CON_RTES (TravelMapping#492)
COMBINE_CON_RTES (TravelMapping#492)