From 6200dc75c1f65e030e85b6cdc324ad6499f91ab2 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Fri, 25 Dec 2020 20:25:13 +0200 Subject: [PATCH] Assign the same TSS score to FreeRide as Zwift does --- README.md | 1 - src/Intensity.ts | 7 ++++--- test/__snapshots__/cli.test.ts.snap | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3a3ac7e..c955df7 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,6 @@ console.log(stats(workout)); - Unsupported params: message duration & y-position - More restricted syntax for text (with quotes) - Concatenate similar intervals -- Sync TSS prediction of free-ride with Zwift (64 TSS for 1h freeride) - Distinguish between terrain-sensitive and insensitive free-ride. - Syntax for comments placed relative to previous ones, e.g. `@ +00:10` - Detect overlaps of comments. diff --git a/src/Intensity.ts b/src/Intensity.ts index 78eaf10..544298c 100644 --- a/src/Intensity.ts +++ b/src/Intensity.ts @@ -49,15 +49,16 @@ export class RangeIntensity implements Intensity { export class FreeIntensity implements Intensity { get value() { - return 0; + // To match Zwift, which gives 64 TSS for 1h of freeride. + return 0.8; } get start() { - return 0; + return this.value; } get end() { - return 0; + return this.value; } get zone() { diff --git a/test/__snapshots__/cli.test.ts.snap b/test/__snapshots__/cli.test.ts.snap index fe4ac29..d0093c5 100644 --- a/test/__snapshots__/cli.test.ts.snap +++ b/test/__snapshots__/cli.test.ts.snap @@ -300,10 +300,10 @@ exports[`Generate stats examples/ftp-test.txt 1`] = ` " Total duration: 45 minutes -Average intensity: 36% -Normalized intensity: 71% +Average intensity: 72% +Normalized intensity: 81% -TSS: 37 +TSS: 49 XP: 336 Zone Distribution: