Class: OpenSkill::Models::BradleyTerryPart::TeamRating
- Inherits:
-
Object
- Object
- OpenSkill::Models::BradleyTerryPart::TeamRating
- Defined in:
- lib/openskill/models/bradley_terry_part.rb
Overview
Internal class for team ratings
Instance Attribute Summary collapse
-
#mu ⇒ Object
readonly
Returns the value of attribute mu.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#sigma_squared ⇒ Object
readonly
Returns the value of attribute sigma_squared.
-
#team ⇒ Object
readonly
Returns the value of attribute team.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(mu:, sigma_squared:, team:, rank:) ⇒ TeamRating
constructor
A new instance of TeamRating.
- #to_s ⇒ Object
Constructor Details
#initialize(mu:, sigma_squared:, team:, rank:) ⇒ TeamRating
Returns a new instance of TeamRating.
355 356 357 358 359 360 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 355 def initialize(mu:, sigma_squared:, team:, rank:) @mu = mu.to_f @sigma_squared = sigma_squared.to_f @team = team @rank = rank.to_i end |
Instance Attribute Details
#mu ⇒ Object (readonly)
Returns the value of attribute mu.
353 354 355 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 353 def mu @mu end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
353 354 355 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 353 def rank @rank end |
#sigma_squared ⇒ Object (readonly)
Returns the value of attribute sigma_squared.
353 354 355 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 353 def sigma_squared @sigma_squared end |
#team ⇒ Object (readonly)
Returns the value of attribute team.
353 354 355 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 353 def team @team end |
Instance Method Details
#==(other) ⇒ Object
362 363 364 365 366 367 368 369 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 362 def ==(other) return false unless other.is_a?(TeamRating) @mu == other.mu && @sigma_squared == other.sigma_squared && @team == other.team && @rank == other.rank end |
#hash ⇒ Object
371 372 373 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 371 def hash [@mu, @sigma_squared, @team, @rank].hash end |
#to_s ⇒ Object
375 376 377 |
# File 'lib/openskill/models/bradley_terry_part.rb', line 375 def to_s "TeamRating(mu=#{@mu}, sigma_squared=#{@sigma_squared}, rank=#{@rank})" end |