diff options
author | stuebinm | 2022-08-28 21:33:33 +0200 |
---|---|---|
committer | stuebinm | 2022-08-28 21:34:54 +0200 |
commit | f7066888652ed3326017adf2eb6786a21043ebf5 (patch) | |
tree | 82b14b74bd352b553eb4036f48b15d3a2c4cae37 /lib/Extrapolation.hs | |
parent | 1b2e30c134c996e82c282b21099f21501dd966ac (diff) |
some config thingyesod
works kinda well, but doesn't complain about unknown config values in
json, which is kinda hmpf tbh
Diffstat (limited to '')
-rw-r--r-- | lib/Extrapolation.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Extrapolation.hs b/lib/Extrapolation.hs index 9b3f89f..4b427d0 100644 --- a/lib/Extrapolation.hs +++ b/lib/Extrapolation.hs @@ -50,7 +50,7 @@ linearDelay GTFS{..} trip@Trip{..} TrainPing{..} runningDay = unsafePerformIO $ print (observedProgress, expectedProgress) pure $ round $ (expectedProgress - observedProgress) * int2Double expectedTravelTime where closestPoint = - minimumBy (compare `on` (euclid (trainPingLat, trainPingLong))) line + minimumBy (compare `on` euclid (trainPingLat, trainPingLong)) line nextStop = snd $ minimumBy (compare `on` fst) $ V.filter (\(dist,_) -> dist > 0) @@ -64,8 +64,8 @@ linearDelay GTFS{..} trip@Trip{..} TrainPing{..} runningDay = unsafePerformIO $ toSeconds (stopArrival nextStop) tzseries trainPingTimestamp - toSeconds (stopDeparture lastStop) tzseries trainPingTimestamp expectedProgress = - (int2Double ((utcToSeconds trainPingTimestamp runningDay) - - toSeconds (stopDeparture lastStop) tzseries trainPingTimestamp)) + int2Double (utcToSeconds trainPingTimestamp runningDay + - toSeconds (stopDeparture lastStop) tzseries trainPingTimestamp) / int2Double expectedTravelTime -- where crop a -- | a < 0 = 0 |