Class: TrueskillThroughTime::Player
- Inherits:
-
Object
- Object
- TrueskillThroughTime::Player
- Defined in:
- lib/TrueskillThroughTime.rb
Instance Attribute Summary collapse
-
#beta ⇒ Object
Returns the value of attribute beta.
-
#gamma ⇒ Object
Returns the value of attribute gamma.
-
#prior ⇒ Object
Returns the value of attribute prior.
-
#prior_draw ⇒ Object
Returns the value of attribute prior_draw.
Instance Method Summary collapse
-
#initialize(prior = Gaussian.new(MU, SIGMA), beta = BETA, gamma = GAMMA, prior_draw = NINF) ⇒ Player
constructor
A new instance of Player.
- #inspect ⇒ Object
- #performance ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(prior = Gaussian.new(MU, SIGMA), beta = BETA, gamma = GAMMA, prior_draw = NINF) ⇒ Player
Returns a new instance of Player.
299 300 301 302 303 304 |
# File 'lib/TrueskillThroughTime.rb', line 299 def initialize(prior=Gaussian.new(MU, SIGMA), beta=BETA, gamma=GAMMA, prior_draw=NINF) @prior = prior @beta = beta @gamma = gamma @prior_draw = prior_draw end |
Instance Attribute Details
#beta ⇒ Object
Returns the value of attribute beta.
298 299 300 |
# File 'lib/TrueskillThroughTime.rb', line 298 def beta @beta end |
#gamma ⇒ Object
Returns the value of attribute gamma.
298 299 300 |
# File 'lib/TrueskillThroughTime.rb', line 298 def gamma @gamma end |
#prior ⇒ Object
Returns the value of attribute prior.
298 299 300 |
# File 'lib/TrueskillThroughTime.rb', line 298 def prior @prior end |
#prior_draw ⇒ Object
Returns the value of attribute prior_draw.
298 299 300 |
# File 'lib/TrueskillThroughTime.rb', line 298 def prior_draw @prior_draw end |
Instance Method Details
#inspect ⇒ Object
314 315 316 |
# File 'lib/TrueskillThroughTime.rb', line 314 def inspect to_s end |
#performance ⇒ Object
306 307 308 |
# File 'lib/TrueskillThroughTime.rb', line 306 def performance Gaussian.new(@prior.mu, Math.sqrt(@prior.sigma**2 + @beta**2)) end |
#to_s ⇒ Object
310 311 312 |
# File 'lib/TrueskillThroughTime.rb', line 310 def to_s "Player(Gaussian(mu=#{(@prior.mu)}, sigma=#{(@prior.sigma)}), beta=#{(@beta)}, gamma=#{(@gamma)})" end |