#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: Karl-Dieter Crisman
Authors: Vince Knight, | Work issues:
James Campbell | Commit:
Report Upstream: N/A | dea6ac3c8f3801c97ec018ad5ee7d2152bd3eaf4
Branch: | Stopgaps:
u/vinceknight/nearing_the_finish_line|
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vinceknight):
Replying to [comment:45 kcrisman]:
> Wow, this is all great work. Good catch on the ''correct'' place to put
`None`! A couple now super-minor things.
Feels really good to be getting there! Thank you very much for all the
time you're putting on this :)
Have addressed pretty much everything, only things remaining seem to be
some inconsistencies of behaviour between various machines.
>
> * With this wording
> {{{
> Here is a test that failed during development::
> }}}
> Maybe that's a bit too pessimistic, just "another test" is fine, or in
the updated version something like
> {{{
> Testing against an error in `check_NE`::
> }}}
> and similarly in other situations.
Have changed the wording where relevant.
> * I have a feeling this one is also optional? But I didn't get an
error.
> {{{
> + sage: print lrs_output[5:-4]
> }}}
Have added optional tag. It failed for me when running without
`--optional=all`.
> * A typo that means this won't ever be tested...
> {{{
> + sage: N.obtain_nash(algorithm='lrs') # optional t- lrs
> }}}
Fixed.
> * This one just tests that it exists, not the solutions (though
presumably this example has now gotten lots of traction!)
> {{{
> + sage: A = matrix(3, [-7, -5, 5, 5, 5, 3, 1, -6, 1])
> + sage: B = matrix(3, [-9, 7, 9, 6, -2, -3, -4, 6, -10])
> + sage: N = NormalFormGame([A, B])
> }}}
Woops (I think I got tired here): have added actual tests.
> * Can you confirm that what went wrong with the parser is the following:
lrs returns equilibria in the form of several possible player 2 strategies
for each player 1 strategy, but you just assumed that each player 2
strategy corresponded to a different player 1 strategy? That's what the
change in code looks like.
Yeah that was exactly what the problem was (my mistake: when James wrote
the parser I did not clarify exactly what the output of lrs could be).
> * You need this test fixed (easy):
> {{{
> sage -t src/sage/game_theory/normal_form_game.py
> **********************************************************************
> File "src/sage/game_theory/normal_form_game.py", line 150, in
sage.game_theory.normal_form_game
> Failed example:
> p += plot((A * vector([y, 1 - y]))[1], y, 0, 1, color='red',
legend_label='$u_1(r_2, (y, 1-y))$'); p
> Expected nothing
> Got:
> Graphics object consisting of 2 graphics primitives
> **********************************************************************
> }}}
This is a weird one: the test doesn't fail for me as is but if I throw in
`Graphics object consisting of 2 graphics primitives` I then get:
{{{
File "src/sage/game_theory/normal_form_game.py", line 150, in
sage.game_theory.normal_form_game
Failed example:
p += plot((A * vector([y, 1 - y]))[1], y, 0, 1, color='red',
legend_label='$u_1(r_2, (y, 1-y))$'); p
Expected:
Graphics object consisting of 2 graphics primitives
Got:
<BLANKLINE>
}}}
Not to sure why we would be getting different output? I'm more confused by
the behaviour on my machines (Mac OS X and also Ubuntu 14.04), when I
added that `;p` I actually expected the test to fail...
I have left as is so that I don't have tests that fail on my machines but
perhaps easiest to remove the `;p`?
> * In built doc, apparently {{{`i`th}}} disagrees with Sage's
Sphinxification and gives it indigestion. Changing it to {{{`i` th}}}
fixes things, but I get that this might not be desirable. Unfortunately,
{{{:math:`i`th}}} doesn't give what we want either.
Have changed the wording so we don't have an issue.
> * Also, apparently lazy importing `PIPE` was indeed what caused it to be
built for me in the documentation.
To clarify: I'm still not getting anything to do with `PIPE` so is this
all ok or should I investigate and attempt to fix?
>
> But I think that's it! Commendable work. Now we just have to get the
''rest'' of this game theory stuff working, including getting gambit to
build right...
--
Ticket URL: <http://trac.sagemath.org/ticket/16954#comment:47>
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.