irating 0.1.0

Estimate iRacing iRating changes
Documentation
  • Coverage
  • 0%
    0 out of 11 items documented0 out of 3 items with examples
  • Size
  • Source code size: 21.19 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 379.87 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Turbo87/irating-rs
    4 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Turbo87

iRacing iRating Calculator

A Rust library to estimate iRacing iRating changes.

The code in this repository is based on the iRacing SOF iRating Calculator v1_1.xlsx shared in https://github.com/SIMRacingApps/SIMRacingApps/issues/209#issuecomment-531877336

Usage

fn main() {
    let race_results = vec![
        ("Driver 1", 1, 3203, true).into(),
        ("Driver 2", 2, 3922, true).into(),
        ("Driver 3", 3, 2974, true).into(),
        ("Driver 4", 4, 1739, true).into(),
        ("Driver 5", 5, 1250, true).into(),
        ("Driver 6", 6, 2588, false).into(),
    ];

    let results = irating::calculate(race_results);
    for result in results {
        println!(
            "#{}  {}: {} -> {} ({}{})",
            result.race_result.finish_rank,
            result.race_result.driver,
            result.race_result.start_irating,
            result.new_irating,
            if result.irating_change > 0. { "+" } else { "" },
            result.irating_change
        );
    }
}

Output:

#1  Driver 1: 3203 -> 3280 (+76.789154)
#2  Driver 2: 3922 -> 3939 (+16.828392)
#3  Driver 3: 2974 -> 2979 (+4.8352695)
#4  Driver 4: 1739 -> 1750 (+11.098258)
#5  Driver 5: 1250 -> 1243 (-6.864749)
#6  Driver 6: 2588 -> 2485 (-102.686325)

License

This project is licensed under either of

at your option.