+ rating_group -= 1
+ non_rated_group = 999 # large enough
+ yaml["players"][non_rated_group] = {}
+ $players.each_key do |id|
+ # skip players who have already been rated
+ found = false
+ (0..rating_group).each do |i|
+ found = true if yaml["players"][i][id]
+ break if found
+ end
+ next if found
+
+ v = GSL::Vector[0, 0]
+ $players[id].each_value {|value| v += value}
+ next if v[0] < 1 && v[1] < 1
+
+ yaml["players"][non_rated_group][id] =
+ { 'name' => id.split("+")[0],
+ 'rating_group' => non_rated_group,
+ 'rate' => 0,
+ 'last_modified' => $players_time[id].dup,
+ 'win' => v[0],
+ 'loss' => v[1]}
+ end
+ unless validate(yaml)
+ $stderr.puts "Aborted. It did not result in valid ratings."
+ $stderr.puts yaml.to_yaml if $DEBUG
+ exit 10
+ end