Zero-Sum Games
Game Problem
OperationsResearchModels.Game.GameProblem — TypeGameProblemDescription
Defines the problem of a zero-sum game.
Fields
decisionMatrix::Matrix{<:Real}: The payoff matrix of the game designed for the row player.
Game solver of the game matrix designed for the row player
OperationsResearchModels.solve — Methodsolve(p::GameProblem; verbose::Bool = false)::Vector{GameResult}Solves a zero-sum game using the simplex method.
Arguments
p::GameProblem: The problem instance containing the decision matrix.verbose: If true, prints the model information.
Returns
- An array of
GameResultobjects containing the probabilities and value of the game.
Example
mat = [1 4 5; 5 6 2]
# 1 4 5
# 5 6 2
# The row player has 2 strategies, and the column player has 3 strategies.
# If the row player selects the first strategy and the column player selects the second strategy,
# the row player receives 4.
problem = GameProblem(mat)
result = solve(problem)
result1 = result[1] # The result for the row player
println(result1.probabilities)
# 2-element Vector{Float64}:
# 0.42857142857142855
# 0.5714285714285714
println(result1.value)
# 3.285714285714285
result2 = result[2] # The result for the column player
println(result2.probabilities)
# 3-element Vector{Float64}:
# 0.42857142857142855
# -0.0
# 0.5714285714285714
println(result2.value)
# -3.285714285714285GameResult
OperationsResearchModels.Game.GameResult — TypeGameResultDescription
A structure to hold the result of a game.
Fields
probabilities: Probabilities of the strategiesvalue: Value of the gamemodel::JuMP.Model: The JuMP model used to solve the game.