Class: PriorFactor

Inherits:
Factor show all
Defined in:
lib/TrueSkill/FactorGraph/PriorFactor.rb

Instance Attribute Summary

Attributes inherited from Factor

#vars

Instance Method Summary collapse

Methods inherited from Factor

#var

Constructor Details

#initialize(var, val, dynamic = 0) ⇒ PriorFactor

Returns a new instance of PriorFactor


6
7
8
9
10
# File 'lib/TrueSkill/FactorGraph/PriorFactor.rb', line 6

def initialize(var,val,dynamic=0)
  super([var])
  @val=val
  @dynamic=dynamic
end

Instance Method Details

#downObject


12
13
14
15
16
# File 'lib/TrueSkill/FactorGraph/PriorFactor.rb', line 12

def down
  sigma=Math.sqrt(@val.sigma**2 + @dynamic ** 2)
  value=Gaussian.new @val.mu,sigma
  var.update_value self,0,0,value
end

#to_sObject


17
18
19
# File 'lib/TrueSkill/FactorGraph/PriorFactor.rb', line 17

def to_s
  return "<PriorFactor "+self.object_id.to_s+">"
end