You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/game.jl
+56-1Lines changed: 56 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,25 @@ using JuMP, HiGHS
5
5
6
6
import..OperationsResearchModels: solve
7
7
8
+
export GameProblem
9
+
export GameResult
10
+
export StrategyType
11
+
12
+
"""
13
+
StrategyType
14
+
15
+
# Description
16
+
17
+
An enumeration to represent the type of strategy in a game.
18
+
19
+
- `Pure`: Indicates that the optimal strategy is pure, meaning that the player should choose one strategy with probability 1.
20
+
- `Mixed`: Indicates that the optimal strategy is mixed, meaning that the player should randomize between multiple strategies with certain probabilities.
21
+
"""
22
+
@enum StrategyType begin
23
+
Pure
24
+
Mixed
25
+
end
26
+
8
27
9
28
"""
10
29
GameProblem
@@ -34,12 +53,18 @@ A structure to hold the result of a game.
34
53
- `probabilities`: Probabilities of the strategies
35
54
- `value`: Value of the game
36
55
- `model::JuMP.Model`: The JuMP model used to solve the game.
56
+
- `alpha::Float64`: The lower bound of the game value (maximin).
57
+
- `beta::Float64`: The upper bound of the game value (minimax).
58
+
- `strategytype::StrategyType`: Indicates whether the optimal strategy is pure or mixed.
37
59
38
60
"""
39
61
struct GameResult
40
62
probabilities::Any
41
63
value::Any
42
64
model::JuMP.Model
65
+
alpha::Float64
66
+
beta::Float64
67
+
strategytype::StrategyType
43
68
end
44
69
45
70
@@ -134,10 +159,40 @@ function game_solver(gamematrix::Matrix{<:Real}; verbose::Bool = false)::GameRes
0 commit comments