Class: Jubatus::Bandit::ArmInfo
- Inherits:
-
Object
- Object
- Jubatus::Bandit::ArmInfo
- Includes:
- Common
- Defined in:
- lib/jubatus/bandit/types.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#trial_count ⇒ Object
readonly
Returns the value of attribute trial_count.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(trial_count, weight) ⇒ ArmInfo
constructor
A new instance of ArmInfo.
- #to_msgpack(out = '') ⇒ Object
- #to_s ⇒ Object
Methods included from Common
Constructor Details
#initialize(trial_count, weight) ⇒ ArmInfo
Returns a new instance of ArmInfo.
15 16 17 18 |
# File 'lib/jubatus/bandit/types.rb', line 15 def initialize(trial_count, weight) @trial_count = trial_count @weight = weight end |
Instance Attribute Details
#trial_count ⇒ Object (readonly)
Returns the value of attribute trial_count.
39 40 41 |
# File 'lib/jubatus/bandit/types.rb', line 39 def trial_count @trial_count end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
39 40 41 |
# File 'lib/jubatus/bandit/types.rb', line 39 def weight @weight end |
Class Method Details
Instance Method Details
#to_msgpack(out = '') ⇒ Object
20 21 22 23 |
# File 'lib/jubatus/bandit/types.rb', line 20 def to_msgpack(out = '') t = [@trial_count, @weight] return TYPE.to_msgpack(t) end |
#to_s ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/jubatus/bandit/types.rb', line 30 def to_s gen = Jubatus::Common::MessageStringGenerator.new gen.open("arm_info") gen.add("trial_count", @trial_count) gen.add("weight", @weight) gen.close() return gen.to_s end |