Skip to content

Commit 018ee29

Browse files
committed
Add default values to documentation
1 parent 65176ab commit 018ee29

File tree

13 files changed

+35
-13
lines changed

13 files changed

+35
-13
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ use skillratings::{
7777
};
7878

7979
// Initialise a new player rating.
80-
// The default values are: 1500.0, 350.0, and 0.06.
80+
// The default values are: 1500, 350, and 0.06.
8181
let player_one = Glicko2Rating::new();
8282

8383
// Or you can initialise it with your own values of course.
@@ -114,6 +114,7 @@ use skillratings::{
114114
};
115115

116116
// We initialise Team One as a Vec of multiple TrueSkillRatings.
117+
// The default values for the rating are: 25, 25/3 ≈ 8.33.
117118
let team_one = vec![
118119
TrueSkillRating {
119120
rating: 33.3,
@@ -163,6 +164,7 @@ use skillratings::{
163164

164165
// Initialise the teams as Vecs of WengLinRatings.
165166
// Note that teams do not necessarily have to be the same size.
167+
// The default values for the rating are: 25, 25/3 ≈ 8.33.
166168
let team_one = vec![
167169
WengLinRating {
168170
rating: 25.1,
@@ -224,7 +226,7 @@ This example is using *Glicko* (*not Glicko-2!*) to demonstrate.
224226
use skillratings::glicko::{expected_score, GlickoRating};
225227

226228
// Initialise a new player rating.
227-
// The default values are: 1500.0, and 350.0.
229+
// The default values are: 1500, and 350.
228230
let player_one = GlickoRating::new();
229231

230232
// Initialising a new rating with custom numbers.
@@ -257,6 +259,7 @@ use skillratings::{
257259
};
258260

259261
// We initialise a new Elo Rating here.
262+
// The default rating value is 1000.
260263
let player = EloRating { rating: 1402.1 };
261264

262265
// We need a list of results to pass to the elo_rating_period function.

src/dwz.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
//!
2525
//! // Or you can initialise it with your own values of course.
2626
//! // Imagine these numbers being pulled from a database.
27+
//! // The default rating is 1000, and the index denotes the amount of tournaments played.
2728
//! let (some_rating, some_index, some_age) = (1325.0, 51, 27);
2829
//! let player_two = DWZRating {
2930
//! rating: some_rating,

src/elo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! Outcomes,
1616
//! };
1717
//!
18-
//! // Initialise a new player rating.
18+
//! // Initialise a new player rating with a rating of 1000.
1919
//! let player_one = EloRating::new();
2020
//!
2121
//! // Or you can initialise it with your own values of course.

src/fifa.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Outcomes,
1818
//! };
1919
//!
20-
//! // Initialise a new team rating.
20+
//! // Initialise a new team rating with a rating of 1000.
2121
//! let team_one = FifaRating::new();
2222
//!
2323
//! // Or you can initialise it with your own values of course.
@@ -33,6 +33,8 @@
3333
//! // The config allows you to specify certain values in the Fifa calculation.
3434
//! // Here we set the importance factor to 50.0, and the knockout factor to false.
3535
//! // Which corresponds to a World Cup Group Stage match.
36+
//! // For more information on how to customise the config,
37+
//! // please check out the FifaConfig struct.
3638
//! let config = FifaConfig {
3739
//! importance: 50.0,
3840
//! knockout: false,

src/glicko.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! Outcomes,
2020
//! };
2121
//!
22-
//! // Initialise a new player rating.
22+
//! // Initialise a new player rating with a rating of 1500 and a deviation of 350.
2323
//! let player_one = GlickoRating::new();
2424
//!
2525
//! // Or you can initialise it with your own values of course.

src/glicko2.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Outcomes,
1818
//! };
1919
//!
20-
//! // Initialise a new player rating.
20+
//! // Initialise a new player rating with a rating of 1500, a deviation of 350 and a volatility of 0.06.
2121
//! let player_one = Glicko2Rating::new();
2222
//!
2323
//! // Or you can initialise it with your own values of course.
@@ -36,6 +36,8 @@
3636
//! // Here we set the Tau value to 0.9, instead of the default 0.5.
3737
//! // This will increase the change in volatility over time.
3838
//! // According to Mark Glickman, values between 0.3 and 1.2 are reasonable.
39+
//! // For more information on how to customise the config,
40+
//! // please check out the Glicko2Config struct.
3941
//! let config = Glicko2Config {
4042
//! tau: 0.9,
4143
//! ..Default::default()

src/glicko_boost.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//! Outcomes,
3131
//! };
3232
//!
33-
//! // Initialise a new player rating.
33+
//! // Initialise a new player rating with a rating of 1500 and a deviation of 350.
3434
//! let player_one = GlickoBoostRating::new();
3535
//!
3636
//! // Or you can initialise it with your own values of course.
@@ -45,6 +45,8 @@
4545
//! let outcome = Outcomes::WIN;
4646
//!
4747
//! // The config allows you to specify certain values in the Glicko-Boost calculation.
48+
//! // For more information on how to customise the config,
49+
//! // please check out the GlickoBoostConfig struct.
4850
//! let config = GlickoBoostConfig {
4951
//! // The eta value describes the advantage of player_one.
5052
//! // 30.0 is roughly accurate for playing White in Chess.

src/ingo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
//!
2424
//! // Or you can initialise it with your own values of course.
2525
//! // Imagine these numbers being pulled from a database.
26+
//! // The default rating is 230. Unlike with other algorithms, with Ingo a lower rating is more desirable.
2627
//! let (some_rating, some_age) = (150.4, 23);
2728
//! let player_two = IngoRating {
2829
//! rating: some_rating,

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
//! };
8686
//!
8787
//! // Initialise a new player rating.
88-
//! // The default values are: 1500.0, 350.0, and 0.06.
88+
//! // The default values are: 1500, 350, and 0.06.
8989
//! let player_one = Glicko2Rating::new();
9090
//!
9191
//! // Or you can initialise it with your own values of course.
@@ -122,6 +122,7 @@
122122
//! };
123123
//!
124124
//! // We initialise Team One as a Vec of multiple TrueSkillRatings.
125+
//! // The default values for the rating are: 25, 25/3 ≈ 8.33.
125126
//! let team_one = vec![
126127
//! TrueSkillRating {
127128
//! rating: 33.3,
@@ -151,7 +152,7 @@
151152
//! // The config allows you to specify certain values in the TrueSkill calculation.
152153
//! let config = TrueSkillConfig::new();
153154
//!
154-
//! // The trueskill_teams function will calculate the new ratings for both teams and return them.
155+
//! // The trueskill_two_teams function will calculate the new ratings for both teams and return them.
155156
//! let (new_team_one, new_team_two) = trueskill_two_teams(&team_one, &team_two, &outcome, &config);
156157
//!
157158
//! // The rating of the first player on team one decreased by around ~1.2 points.
@@ -171,6 +172,7 @@
171172
//!
172173
//! // Initialise the teams as Vecs of WengLinRatings.
173174
//! // Note that teams do not necessarily have to be the same size.
175+
//! // The default values for the rating are: 25, 25/3 ≈ 8.33.
174176
//! let team_one = vec![
175177
//! WengLinRating {
176178
//! rating: 25.1,
@@ -232,7 +234,7 @@
232234
//! use skillratings::glicko::{expected_score, GlickoRating};
233235
//!
234236
//! // Initialise a new player rating.
235-
//! // The default values are: 1500.0, and 350.0.
237+
//! // The default values are: 1500, and 350.
236238
//! let player_one = GlickoRating::new();
237239
//!
238240
//! // Initialising a new rating with custom numbers.
@@ -265,6 +267,7 @@
265267
//! };
266268
//!
267269
//! // We initialise a new Elo Rating here.
270+
//! // The default rating value is 1000.
268271
//! let player = EloRating { rating: 1402.1 };
269272
//!
270273
//! // We need a list of results to pass to the elo_rating_period function.

src/sticko.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! Outcomes,
2828
//! };
2929
//!
30-
//! // Initialise a new player rating.
30+
//! // Initialise a new player rating with a rating of 1500 and a deviation of 350.
3131
//! let player_one = StickoRating::new();
3232
//!
3333
//! // Or you can initialise it with your own values of course.
@@ -42,6 +42,8 @@
4242
//! let outcome = Outcomes::WIN;
4343
//!
4444
//! // The config allows you to specify certain values in the Sticko calculation.
45+
//! // For more information on how to customise the config,
46+
//! // please check out the StickoConfig struct.
4547
//! let config = StickoConfig {
4648
//! // The gamma value describes the advantage of player_one.
4749
//! // 30.0 is roughly accurate for playing White in Chess.

0 commit comments

Comments
 (0)