Class: Ropt::AntagonisticGames::MatrixGame
- Inherits:
-
Object
- Object
- Ropt::AntagonisticGames::MatrixGame
- Defined in:
- lib/ropt/antagonistic_games/matrix_game.rb
Overview
class for matrix game solver with option of get report string message
Instance Attribute Summary collapse
-
#count_columns ⇒ Object
Returns the value of attribute count_columns.
-
#count_rows ⇒ Object
Returns the value of attribute count_rows.
-
#matrix ⇒ Object
Returns the value of attribute matrix.
Instance Method Summary collapse
-
#initialize(rows) ⇒ MatrixGame
constructor
A new instance of MatrixGame.
- #solve ⇒ Object
Constructor Details
#initialize(rows) ⇒ MatrixGame
Returns a new instance of MatrixGame.
11 12 13 14 15 |
# File 'lib/ropt/antagonistic_games/matrix_game.rb', line 11 def initialize(rows) @matrix = Ropt::VectorMatrixMath::ShellMatrix.create(rows) @count_rows = rows.size @count_columns = rows.first.size end |
Instance Attribute Details
#count_columns ⇒ Object
Returns the value of attribute count_columns.
9 10 11 |
# File 'lib/ropt/antagonistic_games/matrix_game.rb', line 9 def count_columns @count_columns end |
#count_rows ⇒ Object
Returns the value of attribute count_rows.
9 10 11 |
# File 'lib/ropt/antagonistic_games/matrix_game.rb', line 9 def count_rows @count_rows end |
#matrix ⇒ Object
Returns the value of attribute matrix.
9 10 11 |
# File 'lib/ropt/antagonistic_games/matrix_game.rb', line 9 def matrix @matrix end |
Instance Method Details
#solve ⇒ Object
17 18 19 |
# File 'lib/ropt/antagonistic_games/matrix_game.rb', line 17 def solve hash_result end |