Class: Factor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vars) ⇒ Factor

Returns a new instance of Factor.



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

def initialize(vars)
  @vars=vars
  @vars.each do |var|
    var[self]=Gaussian.new
  end
    
end

Instance Attribute Details

#varsObject

Returns the value of attribute vars.



4
5
6
# File 'lib/TrueSkill/FactorGraph/Factor.rb', line 4

def vars
  @vars
end

Instance Method Details

#to_sObject



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

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

#varObject



14
15
16
# File 'lib/TrueSkill/FactorGraph/Factor.rb', line 14

def var
  @vars[0]
end