Games::Tournament::Swiss::Procedure - A wrapper around a swiss pairing algorithm
my $pairing = $tourney->pairing( \@brackets ); require Games::Tournament::Swiss::Procedure; $pairing->matchPlayers; @nextGame = map { @{ $_ } } @{$pairing->matches};
A number of different swiss pairing algorithms exist. This is a wrapper allowing you to swap in a algorithm in a module via a configuration file.
The module that you wrap needs a 'new' constructor and 'matchPlayers' and 'matches' methods.
In Some/Arbitrary/Swiss/Algorithm.pm:
# a possible constructor
$algorithm = Some::Arbitrary::Swiss::Algorithm->new( round => $round, brackets => $brackets, incompatibles => $tourney->incompatibles, byes => $args{byes}, matches => [] )
Called in the Class::Tournament::Swiss method, 'pairing'.
$pairing->matchPlayers;
Run the algorithm adding matches to $pairing->matches. A setter.
%matches = map { $n++ => $_ } @{$pairing->matches}
Gets/sets the matches which the algorithm made. Returns an anonymous array of anonymous arrays of Games::Tournament::Card objects representing the matches in the individual brackets.
$pairing->incompatibles
You may want to have an incompatibles accessor, getting/setting an anonymous hash, keyed on the pairing numbers of the two opponents, of a previous round in which individual pairs of @grandmasters, if any, met. Such a hash is calculated by Games::Tournament::Swiss::incompatibles. B1
$group->byes
You may want to have a byes accessor, getting/setting a anonymous hash, keyed on pairing numbers of players, of a previous round in which these players had a bye. Such a hash is calculated by Games::Tournament::Swiss::byes. B1
Dr Bean, <drbean, followed by the at mark (@), cpan, then a dot, and finally, org>
<drbean, followed by the at mark (@), cpan, then a dot, and finally, org>
Please report any bugs or feature requests to bug-games-tournament-swiss at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Tournament-Swiss. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-games-tournament-swiss at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Games::Tournament::Swiss
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Games-Tournament-Swiss
CPAN Ratings
http://cpanratings.perl.org/d/Games-Tournament-Swiss
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Tournament-Swiss
Search CPAN
http://search.cpan.org/dist/Games-Tournament-Swiss
See http://www.fide.com/official/handbook.asp?level=C04 for the FIDE's Swiss rules.
See http://www.math.utoronto.ca/jjchew/software/tsh/doc/all.html#_pairing_ for John Chew's perl script tsh and some competition systems principles.
See http://search.cpan.org/dist/Algorithm-Pair-Swiss for a swiss pairing algorithm.
Copyright 2006 Dr Bean, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Games::Tournament::Swiss, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Tournament::Swiss
CPAN shell
perl -MCPAN -e shell install Games::Tournament::Swiss
For more information on module installation, please visit the detailed CPAN module installation guide.