correctly handle trips with no stop times, fixes #46

This commit is contained in:
Patrick Brosi 2023-08-21 13:56:46 +02:00
parent 45f508bf34
commit 33a92077df
3 changed files with 41 additions and 20 deletions

View file

@ -776,6 +776,7 @@ EdgeCandMap ShapeBuilder::getECM(
double avgChildT = 0;
if (chldTrNd.trips) avgChildT = chldTrNd.accTime / chldTrNd.trips;
double timeDiff = avgChildT - avgT;
if (timeDiff < 0) timeDiff = 0;
@ -812,7 +813,7 @@ double ShapeBuilder::timePen(int candTime, int schedTime) const {
int diff = abs(candTime - schedTime);
double cNorm = (diff) / standarddev;
double cNorm = diff / standarddev;
return cNorm * cNorm;
}