GameTheory.jl icon indicating copy to clipboard operation
GameTheory.jl copied to clipboard

Symmetric two-player normal form games

Open oyamad opened this issue 8 years ago • 1 comments

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.

oyamad avatar Mar 17 '16 12:03 oyamad

Should we add a NormalFormGameSym2p type?

type NormalFormGameSym2p{T<:Real}
    player::Player{2,T}  # player.payoff_array must be square
    num_actions::Int
end

oyamad avatar Jun 10 '16 04:06 oyamad