|
1 |
| -// Model constants |
2 |
| -pub const MULTIPLIER: f64 = 60.0; |
3 |
| -pub const DEFAULT_VOLATILITY: f64 = 5.0 * MULTIPLIER; |
4 |
| -pub const DEFAULT_RATING: f64 = 15.0 * MULTIPLIER; |
5 |
| -pub const TAU: f64 = DEFAULT_VOLATILITY / 100.0; |
| 1 | +/// The absolute minimum rating any player can have, regardless of performance or decay |
| 2 | +pub const ABSOLUTE_RATING_FLOOR: f64 = 100.0; |
| 3 | + |
| 4 | +/// Beta parameter for the PlackettLuce rating model |
| 5 | +/// Controls how quickly ratings change based on expected vs actual performance |
6 | 6 | pub const BETA: f64 = DEFAULT_VOLATILITY / 2.0;
|
7 |
| -pub const KAPPA: f64 = 0.0001; |
8 |
| -pub const DECAY_DAYS: u64 = 121; |
| 7 | + |
| 8 | +/// Number of days a player can be inactive before their rating begins to decay |
| 9 | +pub const DECAY_DAYS: u64 = 121; // Approximately 4 months |
| 10 | + |
| 11 | +/// Minimum rating that any player can decay to, based on their peak rating |
9 | 12 | pub const DECAY_MINIMUM: f64 = 15.0 * MULTIPLIER;
|
| 13 | + |
| 14 | +/// Amount of rating lost per decay cycle |
10 | 15 | pub const DECAY_RATE: f64 = 0.06 * MULTIPLIER;
|
11 |
| -pub const ABSOLUTE_RATING_FLOOR: f64 = 100.0; |
12 |
| -// Default rating constants for osu! |
13 |
| -pub const OSU_RATING_FLOOR: f64 = MULTIPLIER * 5.0; |
14 |
| -pub const OSU_RATING_CEILING: f64 = MULTIPLIER * 30.0; |
15 |
| -pub const VOLATILITY_GROWTH_RATE: f64 = 0.08 * (MULTIPLIER * MULTIPLIER); |
| 16 | + |
| 17 | +/// Initial volatility, higher values indicate more uncertainty in the rating |
| 18 | +pub const DEFAULT_VOLATILITY: f64 = 5.0 * MULTIPLIER; |
| 19 | + |
| 20 | +/// Fallback default rating used when rating cannot be identified from osu! rank information |
| 21 | +pub const FALLBACK_RATING: f64 = 15.0 * MULTIPLIER; |
| 22 | + |
| 23 | +/// Arbitrary regularization parameter |
| 24 | +pub const KAPPA: f64 = 0.0001; |
| 25 | + |
| 26 | +/// Base multiplier used throughout the system to scale ratings |
| 27 | +/// This brings ratings into a more readable range (e.g., 900 instead of 15) |
| 28 | +pub const MULTIPLIER: f64 = 60.0; |
| 29 | + |
| 30 | +/// Maximum possible initial rating in the osu! ruleset |
| 31 | +pub const OSU_INITIAL_RATING_CEILING: f64 = MULTIPLIER * 30.0; // 1800.0 |
| 32 | + |
| 33 | +/// Minimum possible initial rating in the osu! ruleset before decay |
| 34 | +pub const OSU_INITIAL_RATING_FLOOR: f64 = MULTIPLIER * 5.0; // 300.0 |
| 35 | + |
| 36 | +/// Scaling factor applied to rating changes based on performance frequency |
| 37 | +/// Lower values reduce the impact of infrequent participation |
16 | 38 | pub const PERFORMANCE_SCALING_FACTOR: f64 = 0.3;
|
| 39 | + |
| 40 | +/// Tau parameter for the PlackettLuce rating model |
| 41 | +/// Controls the system's confidence in new ratings |
| 42 | +pub const TAU: f64 = DEFAULT_VOLATILITY / 100.0; |
| 43 | + |
| 44 | +/// Rate at which volatility increases during decay periods |
| 45 | +/// Squared due to working with variance rather than standard deviation |
| 46 | +pub const DECAY_VOLATILITY_GROWTH_RATE: f64 = 0.08 * (MULTIPLIER * MULTIPLIER); |
| 47 | + |
| 48 | +/// Weight applied to Method A in the final rating calculation |
| 49 | +/// Method A: Uses current rating for unplayed games |
17 | 50 | pub const WEIGHT_A: f64 = 0.9;
|
| 51 | + |
| 52 | +/// Weight applied to Method B in the final rating calculation |
| 53 | +/// Method B: Assumes last place for unplayed games |
| 54 | +/// Always equals 1 - WEIGHT_A to ensure weights sum to 1 |
18 | 55 | pub const WEIGHT_B: f64 = 1.0 - WEIGHT_A;
|
0 commit comments