1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 02:40:04 +08:00

Weight difficult strain count against the top strain

This commit is contained in:
apollo-dw
2022-01-04 17:33:23 +00:00
Unverified
parent 391110ca5a
commit dcb969316d
@@ -59,14 +59,15 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
/// <summary>
/// Returns the number of strains above a threshold averaged as the threshold varies.
/// Returns the number of strains weighted against the top strain.
/// The result is scaled by clock rate as it affects the total number of strains.
/// </summary>
public double CountDifficultStrains(double clockRate)
{
List<double> strains = GetCurrentStrainPeaks().ToList();
// This is the average value of strains.Count(s => s > p * strains.Max()) for p between 0 and 1.
double realtimeCount = strains.Sum() / strains.Max();
double topStrain = strains.Max();
double realtimeCount = strains.Sum(s => Math.Pow(s / topStrain, 4));
return clockRate * realtimeCount;
}
}