Skip to content

Commit

Permalink
New consistency factor calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDark98 committed Jan 17, 2025
1 parent 91b28ea commit 6dd56ce
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ private double combinedDifficultyValue(Rhythm rhythm, Reading reading, Colour co
peaks.Add(peak);
}

// We are taking 20% of the top weight spikes in strains to achieve a good perception of the map's peak sections.
List<double> hardStrains = peaks.OrderDescending().ToList().GetRange(0, peaks.Count / 10 * 2);
// We are taking 1% of the top weight spikes in strains to achieve a good perception of the map's peak sections.
List<double> hardStrains = peaks.OrderDescending().ToList().GetRange(0, peaks.Count / 100);

// We are taking 20% of the middle weight spikes in strains to achieve a good perception of the map's overall progression.
List<double> midStrains = peaks.OrderDescending().ToList().GetRange(peaks.Count / 10 * 4, peaks.Count / 10 * 2);

// We can calculate the consitency factor by doing middle weight spikes / most weight spikes.
// It resoult in a value that rappresent the consistency for all peaks in a range number from 0 to 1.
totalConsistencyFactor = midStrains.Average() / hardStrains.Average();
totalConsistencyFactor = peaks.Average() / hardStrains.Average();

double difficulty = 0;
double weight = 1;
Expand Down

0 comments on commit 6dd56ce

Please sign in to comment.