GameTheory.jl
GameTheory.jl copied to clipboard
Sample games
It will be helpful to implement a list of sample games, such as
function prisoners_dilemma(;gain::Real=2, loss::Real=2)
gain <= 0 && throw(ArgumentError("gain must be positive"))
loss <= 0 && throw(ArgumentError("loss must be positive"))
payoff_matrix = [1 -loss;
1+gain 0]
return NormalFormGame(payoff_matrix)
end
(This is just one possible, but seemingly popular, way to normalize the payoffs of Prisoners' Dilemma.)
Perhaps we could put them in a Games.Examples
module users could load if they wanted them?
so this wouldn't work:
using Games
pdg = prisoners_dilemma()
but this would
using Games, Games.Examples
pdg = prisoners_dilemma()
Fine with me.
@oyamad Any news on this issue?
Candidates for the name of the module:
-
Games.Examples
-
Games.Samples
-
Games.Generators
Any thoughts?
Vote for Games.Generators
as it allows users to choose different input, rather than just offers different kinds of games with unchangeable payoff matrices.
I like both Games.Examples
and Games.Generators
I think Games.Examples
feels a little more intuitive, but that is likely just personal preference.
I prefer Games.Generators
the most - I think Games.Examples
and Game.Samples
don't necessarily suggest that users have some discretion in choosing payoffs
For bimatrix_generators
see #53.