Permalink
Browse files

Update lib/saulabs/trueskill/factors/likelihood.rb

Fix for when index is not an integer
  • Loading branch information...
1 parent d0c4468 commit a99e4ad4a8b31dacab11df238278c17f1429ed2f @ChrisLundquist ChrisLundquist committed Oct 14, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/saulabs/trueskill/factors/likelihood.rb
@@ -15,10 +15,11 @@ def initialize(beta_squared, variable1, variable2)
end
def update_message_at(index)
- raise "illegal message index: #{index}" if index < 0 || index > 1
case index
when 0 then update_helper(@messages[0], @messages[1], @variables[0], @variables[1])
when 1 then update_helper(@messages[1], @messages[0], @variables[1], @variables[0])
+ else
+ raise "illegal message index: #{index}"
end
end

0 comments on commit a99e4ad

Please sign in to comment.