GameTheory.jl
GameTheory.jl copied to clipboard
Symmetric two-player normal form games
Should we have a specialized constructor, say normal_form_game_sym_2p
, for symmetric NormalFormGame
with two players?
It replaces this:
function normal_form_game_sym_2p{T<:Real}(payoff_matrix::Matrix{T})
n, m = size(payoff_matrix)
n != m && throw(ArgumentError(
"symmetric two-player game must be represented by a square matrix"
))
player = Player(payoff_matrix)
return NormalFormGame(player, player)
end
This will resolve the type instability issue https://github.com/QuantEcon/Games.jl/issues/2#issuecomment-197400877.
Should we add a NormalFormGameSym2p
type?
type NormalFormGameSym2p{T<:Real}
player::Player{2,T} # player.payoff_array must be square
num_actions::Int
end