Use f64 instead.

This commit is contained in:
2018-10-23 14:59:58 +02:00
parent 1b840e737d
commit b4cce71df4
5 changed files with 38 additions and 38 deletions

View File

@@ -8,27 +8,27 @@ use gaussian::Gaussian;
use matrix::Matrix;
/// Default initial mean of ratings.
const MU: f32 = 25.0;
const MU: f64 = 25.0;
/// Default initial standard deviation of ratings.
const SIGMA: f32 = MU / 3.0;
const SIGMA: f64 = MU / 3.0;
/// Default distance that guarantees about 76% chance of winning.
const BETA: f32 = SIGMA / 2.0;
const BETA: f64 = SIGMA / 2.0;
/// Default dynamic factor.
const TAU: f32 = SIGMA / 100.0;
const TAU: f64 = SIGMA / 100.0;
/// Default draw probability of the game.
const DRAW_PROBABILITY: f32 = 0.10;
const DRAW_PROBABILITY: f64 = 0.10;
/// A basis to check reliability of the result.
const DELTA: f32 = 0.0001;
const DELTA: f64 = 0.0001;
#[derive(Debug, PartialEq)]
pub struct Rating {
pub mu: f32,
pub sigma: f32,
pub mu: f64,
pub sigma: f64,
}
impl Default for Rating {
@@ -191,7 +191,7 @@ fn rate(rating_groups: &[&[Rating]]) {
}
}
fn quality(rating_groups: &[&[Rating]]) -> f32 {
fn quality(rating_groups: &[&[Rating]]) -> f64 {
let flatten_ratings = rating_groups
.iter()
.flat_map(|group| group.iter())