Class: TrueskillThroughTime::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/TrueskillThroughTime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#betaObject

Returns the value of attribute beta.



298
299
300
# File 'lib/TrueskillThroughTime.rb', line 298

def beta
  @beta
end

#gammaObject

Returns the value of attribute gamma.



298
299
300
# File 'lib/TrueskillThroughTime.rb', line 298

def gamma
  @gamma
end

#priorObject

Returns the value of attribute prior.



298
299
300
# File 'lib/TrueskillThroughTime.rb', line 298

def prior
  @prior
end

#prior_drawObject

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

#inspectObject



314
315
316
# File 'lib/TrueskillThroughTime.rb', line 314

def inspect
  to_s
end

#performanceObject



306
307
308
# File 'lib/TrueskillThroughTime.rb', line 306

def performance
  Gaussian.new(@prior.mu, Math.sqrt(@prior.sigma**2 + @beta**2))
end

#to_sObject



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