Class: Saulabs::TrueSkill::Layers::IteratedTeamPerformances
- Defined in:
- lib/saulabs/trueskill/layers/iterated_team_performances.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #build ⇒ Object
- #factors ⇒ Object
-
#initialize(graph, team_perf_diff, team_diff_comp) ⇒ IteratedTeamPerformances
constructor
A new instance of IteratedTeamPerformances.
- #prior_schedule ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(graph, team_perf_diff, team_diff_comp) ⇒ IteratedTeamPerformances
Returns a new instance of IteratedTeamPerformances.
7 8 9 10 11 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 7 def initialize(graph, team_perf_diff, team_diff_comp) super(graph) @tpd = team_perf_diff @tdc = team_diff_comp end |
Instance Method Details
#build ⇒ Object
13 14 15 16 17 18 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 13 def build @tpd.input = @input @tpd.build @tdc.input = @tpd.output @tdc.build end |
#factors ⇒ Object
20 21 22 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 20 def factors @tpd.factors + @tdc.factors end |
#prior_schedule ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 24 def prior_schedule loop_schedule = if @input.size == 2 two_team_loop_schedule elsif @input.size > 2 multiple_team_loop_schedule else raise 'Illegal input' end team_diffs = @tpd.factors.size; Schedules::Sequence.new([loop_schedule, Schedules::Step.new(@tpd.factors[0], 1), Schedules::Step.new(@tpd.factors[team_diffs-1], 2)]) end |