#16331: Game Theory: Build capacity to solve matching games in to Sage.
-------------------------------------+-------------------------------------
       Reporter:  vinceknight        |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.4
      Component:  game theory        |   Resolution:
       Keywords:  Game Theory,       |    Merged in:
  Matching Games,                    |    Reviewers:  Karl-Dieter Crisman,
        Authors:  Vince Knight,      |  Travis Scrimshaw
  James Campbell                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  8b049cea8efb051e59af76f3cda5c11e10fbe674
  
u/vinceknight/game_theory__build_capacity_to_solve_matching_games_in_to_sage_|  
   Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by kcrisman):

 Okay, needs doctest changes.  Some are easy - just adding the new Sage 6.4
 doctest style for graphics.
 {{{

 Failed example:
     plot(g)
 Expected nothing
 Got:
     Graphics object consisting of 7 graphics primitives
 }}}
 Unfortunately, all the ones where the answer is a dictionary will have to
 be changed so that they are not platform-dependent.
 {{{

 Failed example:
     g.solve()
 Expected:
     {0: 3, 1: 4}
 Got:
     {1: 4, 0: 3}
 }}}
 Python dicts don't print in any given order.  :-(

 Next, you have to fix some documentation looks.
 {{{
 ./sage -docbuild reference/game_theory html
 }}}
 See this.
 {{{#!diff
 diff --git a/src/sage/game_theory/matching_game.py
 b/src/sage/game_theory/matching_game.py
 index d5c2480..0ba47c5 100644
 --- a/src/sage/game_theory/matching_game.py
 +++ b/src/sage/game_theory/matching_game.py
 @@ -72,7 +72,7 @@ class MatchingGame(SageObject):
      Two potential inputs are accepted (see below to see the effect of
 each):

      - ``reviewer/suitors_preferences`` -- a dictionary containing the
 -    preferences of all players:
 +      preferences of all players:

       * key - each reviewer/suitors
       * value - a tuple of suitors/reviewers
 @@ -80,7 +80,7 @@ class MatchingGame(SageObject):
      OR:

      - ``integer`` -- an integer simply representing the number of
 reviewers
 -    and suitors.
 +      and suitors.

      To implement the above game in Sage::

 @@ -299,8 +299,8 @@ class MatchingGame(SageObject):
          sage: g
          A matching game with 3 suitors and 3 reviewers

 -     We have an empty set of preferences for a default named set of
 -     preferences::
 +    We have an empty set of preferences for a default named set of
 +    preferences::

          sage: for s in g.suitors():
          ....:     s, s.pref
 @@ -313,15 +313,15 @@ class MatchingGame(SageObject):
          (-2, [])
          (-3, [])

 -     Before trying to solve such a game the algorithm will check if it is
 -     complete or not::
 +    Before trying to solve such a game the algorithm will check if it is
 +    complete or not::

          sage: g.solve()
          Traceback (most recent call last):
          ...
          ValueError: suitor preferences are not complete

 -    To be able to obtain the stable matching we must input the
 preferences:
 +    To be able to obtain the stable matching we must input the
 preferences::

          sage: for s in g.suitors():
          ....:   s.pref = (-1, -2, -3)
 @@ -714,7 +714,7 @@ class MatchingGame(SageObject):
              ValueError: a suitor with name "D" already exists



          If we add a suitor without passing a name then the name
 -        of the suitor will not use one that is already chosen.
 +        of the suitor will not use one that is already chosen::

              sage: suit = {0: (-1,  -2),
              ....:         2: (-2, -1)}
 @@ -785,7 +785,7 @@ class MatchingGame(SageObject):
              ValueError: a reviewer with name "10" already exists

          If we add a reviewer without passing a name then the name
 -        of the reviewer will not use one that is already chosen.
 +        of the reviewer will not use one that is already chosen::

              sage: suit = {0: (-1,  -3),
              ....:         1: (-3, -1)}
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16331#comment:101>
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.

Reply via email to