#16954: Game Theory: Build class for normal form games as well as ability to
obtain
Nash equilibria
-------------------------------------+-------------------------------------
Reporter: vinceknight | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: game theory | Resolution:
Keywords: Game Theory, | Merged in:
Normal Form Games | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | 33861c9b7b01abd3641bc9ddb64973965b1a93c3
u/vinceknight/16954 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by kcrisman):
It's always easier to nitpick than test, because I don't have to think
about branches or start Sage. Plus, I can see it will really take some
time to go through the representation/algorithm stuff. So here goes.
* Dumb question:
{{{
from sage.misc.package import is_package_installed
}}}
Is that really necessary in `all.py`? It does make sense in the other
files.
* minor
{{{
+ Normal form games, also referred to as strategic form games are used
to
+ model situations where agents/players make strategic choices the
outcome
+ of which depends on the strategic choices of all players involved.
}}}
maybe a few commas here
{{{
+ Normal form games, also referred to as strategic form games, are used
to
+ model situations where agents/players make strategic choices, the
outcome
+ of which depends on the strategic choices of all players involved.
}}}
* I'll let "modelled" pass since you are based in the UK ;-)
* I'll let you figure these out
{{{
Amy prefers to player video games
Gambit has it's own Python api
}}}
* You have things like {{{game: ::}}} several times. Typically Sage code
where a colon would be appropriate before a doctest is just {{{game::}}}
even though I suppose you are right that it might not look as good in
built doc.
* In your opening discussion, there is a discrepancy over `1.0` and `1` in
the results of the Battle of the Sexes, also with `3/4` versus `0.75`. I
don't know which is preferable.
* Sage should always be capitalized `Sage` not `sage`.
* You may want to switch to Python 3 formatting in your example of
printing the Nash equilibria utilities.
* By the way, both here and in #16331, I'm wondering whether a lot of the
(great) documentation you have for the main games maybe belongs (also) in
the initial docstring. The reason is that this is what is at the top of
the html/pdf documentation. But maybe these are such short files that the
main game appears at the top anyway. Though for this ticket the starting
documentation is SO long I think that really a lot of it should be at the
top - and hopefully there will be some easy way for someone at the command
line or notebook to then ask for that top bit.
* https://github.com/tturocy/gambit/tree/sage_integration probably not
necessary to have the link currently.
* I think it gets lost here that although you are correct that such games
are technically two matrices, they are nearly universally represented as
one matrix with two elements in each position. I'm not sure how to
resolve this, but it should be thought about. This comes up in the LaTeX
method in particular, though also the documentation.
* Similarly, one should think very carefully about the default ''string''
representation of the game being
{{{
{(0, 1): [1, 1], (1, 0): [0, 0], (0, 0): [3, 2], (1, 1): [2, 3]}
}}}
rather than some matrix-y thing. We have lots of ways to print stuff
like that in tables and matrices in Sage. That doesn't mean that
internally it can't be a dict, of course!
* I just love that you are including the plots of the utility functions.
This is so typical for pedagogy and will make this really useful. I'm
cc:ing Greg Bard, who has done this in the past himself, for any comments
he may have on this.
* Input a single matrix creates zero-sum - then implicitly two players is
assumed? But I bet we want to be able to eventually assume representation
of at least three players, even if we can't solve them yet.
* {{{bonus/malus}}} - I've never heard of a "malus" but I like it even if
it isn't a word, it should be, perfect Latinate creation.
* ALL METHODS must have documentation. Even private double underscore
ones.
* Where did the examples from {{{_repr_}}} go? Same for
{{{payoff_matrices}}}.
* I have a similar question about adding players with default strategies
as on the other ticket. What purpose does `_generateutilities` perform?
(And why isn't it `_generate_utilities`?)
* {{{algorithm='enumeration'}}} or not? You have in one spot
{{{``"support enumeration"``}}} which sounds horrible.
* Why is parser.py a separate file? Are you planning on adding more stuff
here that is used in general in other types of games (i.e., not normal
form)? Don't forget to doctest that too...
Have fun! All this said, this is clearly very well-organized and I'm
looking forward to seeing this in Sage. Naturally along with Gambit
compatibility :)
--
Ticket URL: <http://trac.sagemath.org/ticket/16954#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.