Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample games #3

Open
oyamad opened this issue Mar 16, 2016 · 8 comments
Open

Sample games #3

oyamad opened this issue Mar 16, 2016 · 8 comments

Comments

@oyamad
Copy link
Member

oyamad commented Mar 16, 2016

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.)

@sglyon
Copy link
Member

sglyon commented Mar 17, 2016

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()

@oyamad
Copy link
Member Author

oyamad commented Mar 17, 2016

Fine with me.

@QBatista
Copy link
Member

@oyamad Any news on this issue?

@oyamad
Copy link
Member Author

oyamad commented Sep 24, 2017

Candidates for the name of the module:

  1. Games.Examples
  2. Games.Samples
  3. Games.Generators

Any thoughts?

@shizejin
Copy link
Member

Vote for Games.Generators as it allows users to choose different input, rather than just offers different kinds of games with unchangeable payoff matrices.

@cc7768
Copy link
Member

cc7768 commented Sep 24, 2017

I like both Games.Examples and Games.Generators

I think Games.Examples feels a little more intuitive, but that is likely just personal preference.

@QBatista
Copy link
Member

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

@oyamad
Copy link
Member Author

oyamad commented Sep 26, 2017

For bimatrix_generators see #53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants