fix
This commit is contained in:
@@ -135,10 +135,6 @@ export class LevelCalculator {
|
|||||||
metrics: Metrics,
|
metrics: Metrics,
|
||||||
): Standard {
|
): Standard {
|
||||||
const interpolateByWeight = (targetAge: number): Levels => {
|
const interpolateByWeight = (targetAge: number): Levels => {
|
||||||
// check if this is a weight calibrated activity
|
|
||||||
const standard = this.standards.byActivity(activity).getOne();
|
|
||||||
if (standard.metrics.weight === -1) return standard.levels;
|
|
||||||
|
|
||||||
const { lower: lowerAgeWeightStandard, upper: upperAgeWeightStandard } = this.standards
|
const { lower: lowerAgeWeightStandard, upper: upperAgeWeightStandard } = this.standards
|
||||||
.byActivity(activity)
|
.byActivity(activity)
|
||||||
.byGender(metrics.gender)
|
.byGender(metrics.gender)
|
||||||
@@ -163,9 +159,6 @@ export class LevelCalculator {
|
|||||||
const ageLower = lowerAgeStandard.metrics.age;
|
const ageLower = lowerAgeStandard.metrics.age;
|
||||||
const ageUpper = upperAgeStandard.metrics.age;
|
const ageUpper = upperAgeStandard.metrics.age;
|
||||||
|
|
||||||
console.log(activity);
|
|
||||||
console.log("AGES: ", ageLower, ageUpper);
|
|
||||||
|
|
||||||
// Interpolate by age and weight
|
// Interpolate by age and weight
|
||||||
let ageRatio = ageUpper === ageLower ? 1 : (metrics.age - ageLower) / (ageUpper - ageLower);
|
let ageRatio = ageUpper === ageLower ? 1 : (metrics.age - ageLower) / (ageUpper - ageLower);
|
||||||
ageRatio = Math.max(0, Math.min(1, ageRatio));
|
ageRatio = Math.max(0, Math.min(1, ageRatio));
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ const computedPerformances: ActivityPerformance[] = [
|
|||||||
// ENDURANCE
|
// ENDURANCE
|
||||||
{
|
{
|
||||||
activity: activities.RUN,
|
activity: activities.RUN,
|
||||||
performance: minToMs(6) + secToMs(11),
|
performance: minToMs(5) + secToMs(20),
|
||||||
},
|
},
|
||||||
// AGILITY
|
// AGILITY
|
||||||
{
|
{
|
||||||
|
|||||||
+5814
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user