icu_ratings 1.1.9 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/icu_ratings/version.rb +1 -1
- data/spec/tournament_spec.rb +80 -0
- metadata +12 -12
data/lib/icu_ratings/version.rb
CHANGED
data/spec/tournament_spec.rb
CHANGED
@@ -914,5 +914,85 @@ module ICU
|
|
914
914
|
end
|
915
915
|
end
|
916
916
|
end
|
917
|
+
|
918
|
+
context "#rate - Glegowski and Galligan in LCU Div 3 2012" do
|
919
|
+
before(:each) do
|
920
|
+
@t = ICU::RatedTournament.new(desc: 'LCU Div 3 2011-12', no_bonuses: false)
|
921
|
+
|
922
|
+
# The two player's we are most interested in. The problem that led to
|
923
|
+
# this test was later tracked to Glegowski's K-factor (either 24 or 32).
|
924
|
+
@t.add_player(1, kfactor: 24, rating: 1424, desc: 'Cezary Glegolski (10620)')
|
925
|
+
@t.add_player(2, desc: 'Sean Galligan (13021)')
|
926
|
+
|
927
|
+
# Cezary Glegolski opponents.
|
928
|
+
@t.add_player(101, kfactor: 24, rating: 1436, desc: 'Michael Dempsey (323)')
|
929
|
+
@t.add_player(102, kfactor: 24, rating: 1590, desc: 'Michael D. Keating (2216)')
|
930
|
+
@t.add_player(103, kfactor: 40, rating: 1648, desc: 'Ben Quigley (5218)')
|
931
|
+
@t.add_player(104, kfactor: 24, rating: 1664, desc: 'Michael Hanley (536)')
|
932
|
+
@t.add_player(105, kfactor: 24, rating: 1492, desc: 'Sean Loftus (788)')
|
933
|
+
@t.add_player(106, kfactor: 24, rating: 1503, desc: 'Garret Curran (1712)')
|
934
|
+
@t.add_player(107, kfactor: 24, rating: 1692, desc: 'Ernie McElroy (1080)')
|
935
|
+
@t.add_player(108, kfactor: 24, rating: 1681, desc: 'Sean Nolan (4572)')
|
936
|
+
@t.add_player(109, kfactor: 24, rating: 1639, desc: 'Paul Taaffe (2217)')
|
937
|
+
@t.add_player(110, kfactor: 24, rating: 1729, desc: 'Kieran Rogers (4028)')
|
938
|
+
|
939
|
+
# Sean Galligan's opponents.
|
940
|
+
# 105
|
941
|
+
# 106
|
942
|
+
# 107
|
943
|
+
@t.add_player(204, kfactor: 24, rating: 1923, desc: 'Brian Gallagher (468)')
|
944
|
+
# 109
|
945
|
+
@t.add_player(206, kfactor: 24, rating: 1764, desc: 'Rick Goetzee (7190)')
|
946
|
+
# 104
|
947
|
+
@t.add_player(208, kfactor: 24, rating: 1692, desc: 'Colm Buckley (117))')
|
948
|
+
# 102
|
949
|
+
@t.add_player(210, kfactor: 24, rating: 1575, desc: 'John Quigley (1393)')
|
950
|
+
|
951
|
+
# Results.
|
952
|
+
@t.add_result(1, 1, 101, "D")
|
953
|
+
@t.add_result(2, 1, 102, "W")
|
954
|
+
@t.add_result(3, 1, 103, "W")
|
955
|
+
@t.add_result(4, 1, 104, "W")
|
956
|
+
@t.add_result(5, 1, 105, "W")
|
957
|
+
@t.add_result(6, 1, 106, "W")
|
958
|
+
@t.add_result(7, 1, 107, "W")
|
959
|
+
@t.add_result(8, 1, 108, "L")
|
960
|
+
@t.add_result(9, 1, 109, "L")
|
961
|
+
@t.add_result(10, 1, 110, "L")
|
962
|
+
@t.add_result(11, 1, 2, "L")
|
963
|
+
@t.add_result(1, 2, 105, "D")
|
964
|
+
@t.add_result(2, 2, 106, "D")
|
965
|
+
@t.add_result(3, 2, 107, "D")
|
966
|
+
@t.add_result(4, 2, 204, "D")
|
967
|
+
@t.add_result(5, 2, 109, "D")
|
968
|
+
@t.add_result(6, 2, 206, "W")
|
969
|
+
@t.add_result(7, 2, 104, "W")
|
970
|
+
@t.add_result(8, 2, 208, "L")
|
971
|
+
@t.add_result(9, 2, 102, "D")
|
972
|
+
@t.add_result(10, 2, 210, "D")
|
973
|
+
@t.add_result(11, 2, 1, "W")
|
974
|
+
|
975
|
+
# Get the two players of interest.
|
976
|
+
@p1 = @t.player(1)
|
977
|
+
@p2 = @t.player(2)
|
978
|
+
end
|
979
|
+
|
980
|
+
it "should behave like the Access system" do
|
981
|
+
@t.rate!
|
982
|
+
@p1.new_rating.should be_within(0.5).of(1511)
|
983
|
+
@p1.expected_score.should be_within(0.001).of(2.868)
|
984
|
+
@p1.bonus.should == 0
|
985
|
+
@p2.new_rating.should be_within(0.5).of(1705)
|
986
|
+
end
|
987
|
+
|
988
|
+
it "should behave like ratings.ciu.ie" do
|
989
|
+
@p1.send("kfactor=", 32)
|
990
|
+
@t.rate!
|
991
|
+
@p1.new_rating.should be_within(0.5).of(1603)
|
992
|
+
@p1.expected_score.should be_within(0.001).of(2.868)
|
993
|
+
@p1.bonus.should be_within(1).of(63)
|
994
|
+
@p2.new_rating.should be_within(0.5).of(1722)
|
995
|
+
end
|
996
|
+
end
|
917
997
|
end
|
918
998
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icu_ratings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04
|
12
|
+
date: 2012-06-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &70135282405720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70135282405720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70135282404620 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70135282404620
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70135282403120 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70135282403120
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rdoc
|
49
|
-
requirement: &
|
49
|
+
requirement: &70135282401720 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70135282401720
|
58
58
|
description: Build an object that represents a chess tournament then get it to calculate
|
59
59
|
ratings of all the players.
|
60
60
|
email: mark.j.l.orr@googlemail.com
|
@@ -91,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
segments:
|
93
93
|
- 0
|
94
|
-
hash:
|
94
|
+
hash: -2717235365110949062
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
segments:
|
102
102
|
- 0
|
103
|
-
hash:
|
103
|
+
hash: -2717235365110949062
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project: icu_ratings
|
106
106
|
rubygems_version: 1.8.10
|