OSDN Git Service

Renewed year of copyright notice in each file.
[shogi-server/shogi-server.git] / mk_rate
diff --git a/mk_rate b/mk_rate
index be2f8c0..bddbb73 100755 (executable)
--- a/mk_rate
+++ b/mk_rate
@@ -1,11 +1,11 @@
-#!/usr/bin/ruby
+#!/usr/bin/ruby1.9.1
 # $Id$
 #
 # Author:: Daigo Moriwaki
 # Homepage:: http://sourceforge.jp/projects/shogi-server/
 #
 #--
-# Copyright (C) 2006-2009 Daigo Moriwaki <daigo at debian dot org>
+# Copyright (C) 2006-2012 Daigo Moriwaki <daigo at debian dot org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #
 # Sample Command lines that isntall prerequires will work on Debian.
 #
-# * Ruby 1.8.7
+# * Ruby 1.9.3 or 1.8.7 (including Rubygems)
 #
-#   $ sudo aptitude install ruby1.8
-#
-# * Rubygems
-#
-#   $ sudo aptitude install rubygems
+#   $ sudo aptitude install ruby1.9.1
 #
 # * Ruby bindings for the GNU Scientific Library (GSL[http://rb-gsl.rubyforge.org/])
 #
-#   $ sudo aptitude install libgsl-ruby1.8
+#   $ sudo aptitude install ruby-gsl
 #
 # * RGL: {Ruby Graph Library}[http://rubyforge.org/projects/rgl/]
 #
-#   $ sudo gem install rgl
+#   $ sudo gem1.9.1 install rgl
 #
 # == Examples
 #
@@ -346,6 +342,7 @@ class Rating
       old_f      = f
       old_f_nrm2 = old_f.nrm2
       deaccelrate(1.0, old_rate, a, old_f_nrm2)
+      #@rate -= a # Instead, do not deaccelerate
       @record.set(func_vector.nrm2, @rate)
 
       $stderr.printf "|error| : %5.2e\n", a.nrm2 if $DEBUG
@@ -362,6 +359,7 @@ class Rating
     @rate = @record.get
     $stderr.puts "resolved f: %s -> %f" %
       [func_vector.to_a.inspect, func_vector.nrm2] if $DEBUG
+    $stderr.puts "Count: %d" % [@count] if $DEBUG
 
     @rate *= 1.0/K
     finite!
@@ -439,7 +437,7 @@ class WinLossMatrix
             0
           else
             p2 = keys[j]
-            v = p1_hash[p2] || Vector[0,0]
+            v = p1_hash[p2] || GSL::Vector[0,0]
             v[0]
           end
         end)