Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions siteupdate/cplusplus/classes/TravelerList/userlog.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,21 +41,21 @@ void TravelerList::userlog
double t_system_overall = 0;
if (system_region_mileages.find(h) != system_region_mileages.end())
t_system_overall = system_region_miles(h);
log << "System " << h->systemname << " (" << h->level_name() << ") overall: " << format_clinched_mi(t_system_overall, h->total_mileage()) << '\n';
if (t_system_overall)
if (h->active())
active_systems_traveled++;
else preview_systems_traveled++;
if (t_system_overall == h->total_mileage())
if (h->active())
active_systems_clinched++;
else preview_systems_clinched++;
{ if (h->active())
active_systems_traveled++;
else preview_systems_traveled++;
if (t_system_overall == h->total_mileage())
if (h->active())
active_systems_clinched++;
else preview_systems_clinched++;

// stats by region covered by system, always in csmbr for
// the DB, but add to logs only if it's been traveled at
// all and it covers multiple regions
if (t_system_overall)
{ if (h->mileage_by_region.size() > 1)
// stats by region covered by system, always in csmbr for
// the DB, but add to logs only if it's been traveled at
// all and it covers multiple regions
log << "System " << h->systemname << " (" << h->level_name() << ") overall: "
<< format_clinched_mi(t_system_overall, h->total_mileage()) << '\n';
if (h->mileage_by_region.size() > 1)
log << "System " << h->systemname << " by region:\n";
std::list<Region*> sysregions;
for (std::pair<Region* const, double> &rm : h->mileage_by_region)
Expand All@@ -74,12 +74,10 @@ void TravelerList::userlog
if (h->mileage_by_region.size() > 1)
log << " " << region->code << ": " << format_clinched_mi(system_region_mileage, h->mileage_by_region.at(region)) << '\n';
}
}

// stats by highway for the system, by connected route and
// by each segment crossing region boundaries if applicable
if (t_system_overall)
{ std::unordered_map<ConnectedRoute*, double> system_con_umap;
// stats by highway for the system, by connected route and
// by each segment crossing region boundaries if applicable
std::unordered_map<ConnectedRoute*, double> system_con_umap;
unsigned int num_con_rtes_clinched = 0;
log << "System " << h->systemname << " by route (traveled routes only):\n";
for (ConnectedRoute &cr : h->con_route_list)
Expand Down
27 changes: 12 additions & 15 deletions siteupdate/python-teresco/siteupdate.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -3362,24 +3362,22 @@ def run(self):
t_system_overall = 0.0
if h.systemname in t.system_region_mileages:
t_system_overall = math.fsum(list(t.system_region_mileages[h.systemname].values()))
t.log_entries.append("System " + h.systemname + " (" + h.level +
") overall: " +
format_clinched_mi(t_system_overall, math.fsum(list(h.mileage_by_region.values()))))
if t_system_overall > 0.0:
if h.active():
t.active_systems_traveled += 1
else:
t.preview_systems_traveled += 1
if t_system_overall == math.fsum(list(h.mileage_by_region.values())):
if h.active():
t.active_systems_clinched += 1
else:
t.preview_systems_clinched += 1
if t_system_overall == math.fsum(list(h.mileage_by_region.values())):
if h.active():
t.active_systems_clinched += 1
else:
t.preview_systems_clinched += 1

# stats by region covered by system, always in csmbr for
# the DB, but add to logs only if it's been traveled at
# all and it covers multiple regions
if t_system_overall > 0.0:
# stats by region covered by system, always in csmbr for
# the DB, but add to logs only if it's been traveled at
# all and it covers multiple regions
t.log_entries.append("System " + h.systemname + " (" + h.level + ") overall: " +
format_clinched_mi(t_system_overall, math.fsum(list(h.mileage_by_region.values()))))
if len(h.mileage_by_region) > 1:
t.log_entries.append("System " + h.systemname + " by region:")
for region in sorted(h.mileage_by_region.keys()):
Expand All@@ -3393,9 +3391,8 @@ def run(self):
t.log_entries.append(" " + region + ": " + \
format_clinched_mi(system_region_mileage, h.mileage_by_region[region]))

# stats by highway for the system, by connected route and
# by each segment crossing region boundaries if applicable
if t_system_overall > 0.0:
# stats by highway for the system, by connected route and
# by each segment crossing region boundaries if applicable
system_con_dict = dict()
t.con_routes_traveled[h.systemname] = system_con_dict
con_routes_clinched = 0
Expand Down