Zero-sum Game Solver

game

JMcDM.Game.gameFunction
    game(decisionMatrix; verbose = false)

Solve the zero-sum game.

Arguments:

  • decisionMatrix::Array{Float,2}: n × m matrix of gain values for row player.
  • verbose::Bool: Logical value indicating whether the optimization logs are shown or not. Default is false.

Description

game() solves zero-sum games using a gain matrix designed for the row player. The game matrix has n rows and m columns for n and m strategies of row and column players, respectively.

Output

  • ::Array{GameResult, 1}: Vector of GameResult objects that holds mixed strategy probabilities for row

and column players and the value of game. If a pure strategy exists, than the propabilities vector is a one-hat vector.

Examples

julia> # Rock & Paper & Scissors game
julia> mat = [0 -1 1; 1 0 -1; -1 1 0]
3×3 Array{Int64,2}:
  0  -1   1
  1   0  -1
 -1   1   0

julia> result = game(mat);

julia> result
Row Player: 
Probabilities:
[0.3333333333333333, 0.3333333333333333, 0.3333333333333333]
Value of game: 
0.0

Column Player: 
Probabilities:
[0.3333333333333333, 0.3333333333333333, 0.3333333333333333]
Value of game: 
0.0

References

Zhou, Hai-Jun. "The rock–paper–scissors game." Contemporary Physics 57.2 (2016): 151-163.

Dependencies

This method is enabled when the JuMP and Ipopt packages are installed and loaded.

source