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.
9 10 11 12 13 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 9 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
15 16 17 18 19 20 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 15 def build @tpd.input = @input @tpd.build @tdc.input = @tpd.output @tdc.build end |
#factors ⇒ Object
22 23 24 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 22 def factors @tpd.factors + @tdc.factors end |
#prior_schedule ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/saulabs/trueskill/layers/iterated_team_performances.rb', line 26 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 |