Class: Saulabs::TrueSkill::Layers::TeamPerformanceDifferences

Inherits:
Base
  • Object
show all
Defined in:
lib/saulabs/trueskill/layers/team_performance_differences.rb

Instance Attribute Summary

Attributes inherited from Base

#factors, #graph, #input, #output

Instance Method Summary collapse

Methods inherited from Base

#posterior_schedule, #prior_schedule

Constructor Details

#initialize(graph) ⇒ TeamPerformanceDifferences

Returns a new instance of TeamPerformanceDifferences.



7
8
9
# File 'lib/saulabs/trueskill/layers/team_performance_differences.rb', line 7

def initialize(graph)
  super(graph)
end

Instance Method Details

#buildObject



11
12
13
14
15
16
17
# File 'lib/saulabs/trueskill/layers/team_performance_differences.rb', line 11

def build
  (0..@input.size-2).each do |i|
    variable = Gauss::Distribution.new
    @factors << Factors::WeightedSum.new(variable, [@input[i][0], @input[i+1][0]], [1.0, -1.0])
    @output << [variable]
  end
end