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
13 changes: 3 additions & 10 deletions siteupdate/cplusplus/classes/TravelerList/userlog.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,8 +83,7 @@ void TravelerList::userlog
unsigned int num_con_rtes_clinched = 0;
log << "System " << h->systemname << " by route (traveled routes only):\n";
for (ConnectedRoute &cr : h->con_route_list)
{ double con_total_miles = 0;
double con_clinched_miles = 0;
{ double con_clinched_miles = 0;
std::string to_write = "";
for (Route *r : cr.roots)
{ // find traveled mileage on this by this user
Expand All@@ -99,24 +98,19 @@ void TravelerList::userlog
con_clinched_miles += miles;
to_write += " " + r->readable_name() + ": " + format_clinched_mi(miles,r->mileage) + "\n";
}
con_total_miles += r->mileage;
}
if (con_clinched_miles)
{ system_con_umap[&cr] = con_clinched_miles;
char clinched = '0';
/*yDEBUG
if (traveler_name == "oscar" && cr.system->systemname == "usaus" && cr.route == "US85")
printf("\nOscar on US85:\ncon_clinched_miles = %.17f\n con_total_miles = %.17f\n",
con_clinched_miles, con_total_miles);//*/
if (con_clinched_miles == con_total_miles)
if (con_clinched_miles == cr.mileage)
{ num_con_rtes_clinched++;
clinched = '1';
}
sprintf(fstr, "%.15g", con_clinched_miles);
if (!strchr(fstr, '.')) strcat(fstr, ".0");
clin_db_val->add_ccr("('" + cr.roots[0]->root + "','" + traveler_name +
"','" + std::string(fstr) + "','" + clinched + "')");
log << cr.readable_name() << ": " << format_clinched_mi(con_clinched_miles, con_total_miles) << '\n';
log << cr.readable_name() << ": " << format_clinched_mi(con_clinched_miles, cr.mileage) << '\n';
if (cr.roots.size() == 1)
log << " (" << cr.roots[0]->readable_name() << " only)\n";
else log << to_write << '\n';
Expand All@@ -128,7 +122,6 @@ void TravelerList::userlog
num_con_rtes_clinched, (int)h->con_route_list.size(), 100*(double)num_con_rtes_clinched/h->con_route_list.size());
log << "System " << h->systemname << fstr << '\n';
con_routes_traveled[h] = system_con_umap;
//#include "debug/oscars_usaus_ConRtes.cpp"
}
}

Expand Down
18 changes: 10 additions & 8 deletions siteupdate/cplusplus/siteupdate.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -365,7 +365,7 @@ int main(int argc, char *argv[])

// if requested, rewrite data with near-miss points merged in
if (args.nmpmergepath != "" && !args.errorcheck)
{ cout << et.et() << "Writing near-miss point merged wpt files." << endl; //FIXME output dots to indicate progress
{ cout << et.et() << "Writing near-miss point merged wpt files." << endl;
#ifdef threading_enabled
// set up for threaded nmp_merged file writes
hs_it = highway_systems.begin();
Expand All@@ -377,9 +377,13 @@ int main(int argc, char *argv[])
delete thr[t];//*/
#else
for (HighwaySystem *h : highway_systems)
for (Route &r : h->route_list)
r.write_nmp_merged(args.nmpmergepath + "/" + r.rg_str);
{ std::cout << h->systemname << std::flush;
for (Route &r : h->route_list)
r.write_nmp_merged(args.nmpmergepath + "/" + r.rg_str);
std::cout << '.' << std::flush;
}
#endif
cout << endl;
}

#include "functions/concurrency_detection.cpp"
Expand DownExpand Up@@ -765,15 +769,13 @@ int main(int argc, char *argv[])
}
hdstatsfile << "System " << h->systemname << " by route:\n";
for (ConnectedRoute& cr : h->con_route_list)
{ double con_total_miles = 0;
string to_write = "";
{ string to_write = "";
for (Route *r : cr.roots)
{ sprintf(fstr, ": %.2f mi\n", r->mileage);
to_write += " " + r->readable_name() + fstr;
con_total_miles += r->mileage;
cr.mileage += r->mileage;
}
cr.mileage = con_total_miles; //FIXME?
sprintf(fstr, ": %.2f mi", con_total_miles);
sprintf(fstr, ": %.2f mi", cr.mileage);
hdstatsfile << cr.readable_name() << fstr;
if (cr.roots.size() == 1)
hdstatsfile << " (" << cr.roots[0]->readable_name() << " only)\n";
Expand Down
1 change: 1 addition & 0 deletions siteupdate/cplusplus/threads/NmpMergedThread.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,7 @@ void NmpMergedThread(unsigned int id, std::list<HighwaySystem*> *hs_list, std::l
(*it)++;
//printf("NmpMergedThread %02i (*it)++\n", id); fflush(stdout);
mtx->unlock();
std::cout << h->systemname << '.' << std::flush;
for (Route &r : h->route_list)
r.write_nmp_merged(*nmpmergepath + "/" + r.rg_str);
}
Expand Down
12 changes: 4 additions & 8 deletions siteupdate/python-teresco/siteupdate.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -3294,13 +3294,11 @@ def run(self):
hdstatsfile.write(region + ": " + "{0:.2f}".format(h.mileage_by_region[region]) + " mi\n")
hdstatsfile.write("System " + h.systemname + " by route:\n")
for cr in h.con_route_list:
con_total_miles = 0.0
to_write = ""
for r in cr.roots:
to_write += " " + r.readable_name() + ": " + "{0:.2f}".format(r.mileage) + " mi\n"
con_total_miles += r.mileage
cr.mileage = con_total_miles
hdstatsfile.write(cr.readable_name() + ": " + "{0:.2f}".format(con_total_miles) + " mi")
cr.mileage += r.mileage
hdstatsfile.write(cr.readable_name() + ": " + "{0:.2f}".format(cr.mileage) + " mi")
if len(cr.roots) == 1:
hdstatsfile.write(" (" + cr.roots[0].readable_name() + " only)\n")
else:
Expand DownExpand Up@@ -3403,7 +3401,6 @@ def run(self):
con_routes_clinched = 0
t.log_entries.append("System " + h.systemname + " by route (traveled routes only):")
for cr in h.con_route_list:
con_total_miles = 0.0
con_clinched_miles = 0.0
to_write = ""
for r in cr.roots:
Expand All@@ -3420,18 +3417,17 @@ def run(self):
con_clinched_miles += miles
to_write += " " + r.readable_name() + ": " + \
format_clinched_mi(miles,r.mileage) + "\n"
con_total_miles += r.mileage
if con_clinched_miles > 0:
system_con_dict[cr] = con_clinched_miles
clinched = '0'
if con_clinched_miles == con_total_miles:
if con_clinched_miles == cr.mileage:
con_routes_clinched += 1
clinched = '1'
ccr_values.append("('" + cr.roots[0].root + "','" + t.traveler_name
+ "','" + str(con_clinched_miles) + "','"
+ clinched + "')")
t.log_entries.append(cr.readable_name() + ": " + \
format_clinched_mi(con_clinched_miles,con_total_miles))
format_clinched_mi(con_clinched_miles,cr.mileage))
if len(cr.roots) == 1:
t.log_entries.append(" (" + cr.roots[0].readable_name() + " only)")
else:
Expand Down