The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Games::Ratings::Chess::FIDE - calculate changes to FIDE ratings (Elos)

VERSION

This document describes Games::Ratings::Chess::FIDE version 0.0.4

SYNOPSIS

 use Games::Ratings::Chess::FIDE;

 my $player = Games::Ratings::Chess::FIDE->new();
 $player->set_rating(2240);
 $player->set_coefficient(15);
 $player->add_game( {
                      opponent_rating => 2114,
                      result          => 'win',   ## or 'draw' or 'loss'
                    }
                  );

 my $rating_change = sprintf( "%+.2f", $player->get_rating_change() );
 my $new_rating = $player->get_new_rating();

DESCRIPTION

This module provides methods to calculate FIDE rating (Elo) changes for one player, having played one or more rated games. Gains and losses are calculated according to the FIDE rating rules (cmp. FIDE Rating Regulations, FIDE Handbook B.02.10: http://www.fide.com/info/handbook?id=75&view=article).

FIDE uses a table with scoring probabilities in dependence from rating differences between the players.

FIDE does _not_ use the formula P = 1/(1 + 10 ^ [D/400]).

Furthermore FIDE uses a development coefficient (K) depending on the current rating and the number of rated games. * K = 25 for a player with a total of less than 30 games. * K = 15 as long as a player`s rating remains under 2400. * K = 10 once a player`s published rating has reached 2400

INTERFACE

This modules provides the following methods specific to FIDE ratings. Other (more generic) methods for rating calculation are provided by Games::Ratings. Please check the documentation of Games::Ratings for those methods.

get_rating_change

  my $rating_change = sprintf("%+.2f", $player->get_rating_change() );

Calculate rating changes for all stored games and return sum of those changes.

get_new_rating

  my $new_rating = $player->get_new_rating();

Calculate new rating after the given games.

get_points_expected

  my $points_expected = $player->get_points_expected();

Calculate expected points according to rating differences between own rating and opponents ratings.

get_performance

  my $performance = $player->get_performance();

Calculate performance according to average rating of opponents and percentage score.

CONFIGURATION AND ENVIRONMENT

Games::Ratings requires no configuration files or environment variables.

DEPENDENCIES

This module relies on Games::Ratings which provides some generic methods, e.g. * new() * get_rating() * set_rating() * get_coefficient() * set_coefficient() * add_game() * remove_all_games() * DESTROY()

DIAGNOSTICS

At the moment, there are no error or warning messages that the module can generate.

Error message here, perhaps with %s placeholders

[Description of error here]

Another error message here

[Description of error here]

[Et cetera, et cetera]

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

At the moment, it's not possible to compute a FIDE rating for a previously unrated player.

Note, that a missing development coefficient (set via $player->set_coefficient()) may lead to incorrect results. The program tries to guess the correct factor according to the players rating, but it will err for players new to the rating list with less than thirty games played.

Please report any bugs or feature requests to bug-games-ratings@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Christian Bartolomaeus <bartolin@gmx.de>

ACKNOWLEDGMENTS

This module was inspired by Terrence Brannon's module Chess::Elo (http://search.cpan.org/~tbone/Chess-Elo/).

SEE ALSO

http://en.wikipedia.org/wiki/Elo_rating for informations about the Elo system.

http://www.fide.com/info/handbook?id=11&view=category for informations about the FIDE rating system (esp. point 10.0).

LICENCE AND COPYRIGHT

Copyright (c) 2010, Christian Bartolomaeus <bartolin@gmx.de>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.