private WorkoutSegment BuildWorkoutSegment(GenericWorkoutSegment genericWorkoutSegment) { var workoutSegment = new WorkoutSegment(); workoutSegment.Id = genericWorkoutSegment.Id; workoutSegment.Distance = AdjustDistance(genericWorkoutSegment); workoutSegment.TrainingPace = genericWorkoutSegment.TrainingPace; workoutSegment.Speed = AdjustSpeed(genericWorkoutSegment); return(workoutSegment); }
private double AdjustSpeed(GenericWorkoutSegment genericWorkoutSegment) { //clean this up //enhance performance scores to average various distance levels //enhance to factor in fatigue var marathonPace = _athletePerformanceScore.PerformanceScoreItems.Single(psi => psi.RpsDistanceMeters == 42000); return(marathonPace.RpsSpeed); switch (genericWorkoutSegment.TrainingPace) { case GenericTrainingPaces.Walk: break; case GenericTrainingPaces.Jog: break; case GenericTrainingPaces.Easy: break; case GenericTrainingPaces.Medium: break; case GenericTrainingPaces.Tempo: break; case GenericTrainingPaces.Marathon: break; case GenericTrainingPaces.HalfMarathon: break; case GenericTrainingPaces.TenK: break; case GenericTrainingPaces.FiveK: break; case GenericTrainingPaces.Mile: break; case GenericTrainingPaces.Sprint: break; default: throw new ArgumentOutOfRangeException(); } }
private double AdjustDistance(GenericWorkoutSegment genericWorkoutSegment) { //should work, enhance to factor in fatigue return(genericWorkoutSegment.Distance * _athleteToPlanMaxAverageDistanceRatio); }