GithubHelp home page GithubHelp logo

gambitproject / gte Goto Github PK

View Code? Open in Web Editor NEW
85.0 85.0 40.0 9.53 MB

Game Theory Explorer: Build, explore and solve extensive form games.

License: GNU General Public License v3.0

ActionScript 26.87% Java 48.03% C 22.15% HTML 1.14% Makefile 0.34% Shell 0.01% JavaScript 1.48%

gte's People

Contributors

alfongj avatar martinprause avatar megesdal avatar rahulsavani avatar stengel avatar tturocy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gte's Issues

Potential EULA violation

Dear gambitproject,

It has come to our attention through FontFinder that your hosting of NimbusMonL-Bold.otf in this public repository could be a potential violation of the End User License Agreement (EULA) between yourself and the respective foundry.

We recommend that you remove the files to avoid further action.

Sincerely,
The Font Police

export to .pdf and .eps formats

.fig format is simple to convert to .eps and .pdf - with Linux utilities. (Requires sendback to server - not easy on the client.) Question is avoid of cluttering export button, perhaps with selecting a format that stays. (Should remember in preferences.)

stages greyed out in extensive form

After loading in a strategic form game (in the screenshot below, nonoisebagwell.xml) and moving to the extensive form, the stages are greyed out and only the tree stage options are available.

screen shot 2014-03-03 at 17 29 42

Node manipulation by level

Rather than clicking on single nodes for adding nodes, setting players, merging / dissolving info sets (?), allow this operation for the whole level by having a dashed line appear when the mouse hovers over that level, and clicking on that line applies the operation to all nodes indicated by that line.

tree-level50

Specific behavior when adding nodes:
In principle, clicking on that line for "apply to all nodes on that level" just means performing the "add" operation to each single node. However, I think this would be confusing in the following scenario: Suppose the user has first generated children by clicking on individual nodes, and is now on the fourth level with 8 nodes and is getting bored. After giving individual children to the first two of those 8 nodes, he discovers the "level" functionality and clicks on the line. Now, simply applying "add" to all children would result in the first two getting an extra child (now having 3 nodes), with the remaining 6 getting 2 children, which is most certainly not the intention. I think the effect (number of children) should be uniform for all nodes on that level. This would be implemented as follows:

  • find the node with the fewest number of children on that level
  • for all nodes that have that same (lowest) number of children, apply the "add" operation. In particular, nodes that have already several children (e.g., three children), are untouched.
  • the effect is that if all nodes have the same number of children, they are all treated the same way.
  • if the result is not as desired, the user can simply use the undo button.

subgames and subgame perfect equilibria

Identify (and display suitably) subgames in the extensive game, with iterative substitution of equilibrium payoffs to compute (and display suitably) SPNE.
First simple case are perfect-information games.

Bug: deleting move label from sequence table erases game tree

if you erase the label from the sequence table for a particular node the extensive form game is erased from the main screen and some of the buttons freeze. It is possible to re-enter a node name if one of the active buttons (such as player color) is selected, otherwise you cannot type in the label name; if the node name is re-entered, it does not make the game visible again. Note that the game still appears to exist, even though it is not displayed, as the strategic form of the game can still be viewed.

Undo/Redo

Everything that is stored with the game is put on the undo stack: game data, graphical data

The XML file for file storage can serve as undo data.

Not stored are: input mode, zoom.

The existing UNDO functionality was done before game stages, which now requires extension.
Also, drop the AUTOSAVE function.

Encoding UNASSIGNED players / moves / payoffs

This refers to conventions in the file format and program. In principle, these are unambiguous encodings and we could keep them. Question is if we should allow for blank move names.

Because the user may go back to earlier stages when creating
a game, the game may have unassigned players, moves, or
payoffs even if some of these are defined. However, with
unassigned players to nodes the stage cannot go beyond the
PLAYERS stage.

Currently, an UNASSIGNED player is a node without a player
attribute (which is also interpreted as a chance node), but
where the move probabilities are "NaN".

An unassigned MOVE is a blank character. If you manually
replace a single move with a blank and come back to the MOVE
stage, the blank move name will be automatically replaced.
In short, it is hard to use blanks as move names, but then
there is also no good reason to allow them. Logically, the
move name is irrelevant for solving the game.

An unassigned PAYOFF is stored as which is empty.

No dashes in strategy move names. See Fig. 21 in the paper on GTE

"Solved" by using commas instead of dashes. Should be a choosable parameter, blank no good
as used as separator in strategic form. Also omitted "," if moves are single letters have been implemented - although sometimes commas still appear with single letters. Not clear why.

Generated strategy names in the extensive form are too long
with the intermediate dashes. Even worse, these dashes become
long dashes in conversion from XFIG to PDF.
Solution: no dashes, just juxtaposition for single-letter
move names. At some further point, we can extend this as
follows: If a move has 2 or more letters, insert a comma
before and after, and change at the end all double commas
into single blanks and remove leading and trailing commas.
(The "comma" character should be a parameter that can later
maybe configured; use a single routine for that, which is
easy to write - the same for blanks instead of commas can
also be used to pre-process input strings that may have
multiple blanks in them.)

Fit to canvas / resize strategic form = automatic CTRL-L

After you have created a new tree (complete with payoffs in extensive form) you might switch to the strategic form. The matrix of the strategic form is not autoadjusted e.g. the size is too small compared to the canvas. After pressing CTRL+L the matrix is adjusted correctly.

TODO

Resize strategic form automatically if you have switched from the extensive form

delete subtree but keep node unless leaf

The DELETE NODE button (red round minus) has often a massive
and unpredictable effect on layout. Here is my suggestion,
which in a sense reverses the effect of the "ADD NODE"
button:

  • If clicking on a node WITH CHILDREN, remove all children
    and their descendants, but KEEP THE NODE, now as a leaf.
    This will replace the killed subtree by a single node,
    which looks much more predictable.
  • If clicking on a LEAF, remove the leaf.

extreme equilibria and components vs. cliques

This issue arises out of a currently inaccurate implementation of topological components vs. cliques in the gte implementation. The computation of an index of an equilibrium component requires fixing this. In addition, we might want to hook in different ways of obtaining extreme equilibria - Avis et al 2010, see https://github.com/stengel/gambit/wiki/Game-Theory-Resources give multiple options for this.

The output of finding equilibria for bimatrix games, as in the Avis et al 2010 paper (which contains all the details), consists of pair of vertices of certain polytopes which correspond to "extreme" equilibria.

Now, look at the bipartite graph with vertices x for player 1 and y for player 2 as nodes where there is an edge (x,y) if and only if (x,y) is a Nash equilibrium. If no other edge is incident to x or y, this is an isolated equilibrium. In general, one might have another equilibrium (x',y) which shares the equilibrium strategy y with (x,y), for example.

A connected component of this bipartite graph is exactly a connected component of Nash equilibria, as follows:
Consider such a connected component and look at a maximal "clique" U times V (U x V) so that ALL (x,y) in U x V are equilibria. Then all convex combinations of these extreme equilibria are themselves equilibria.

The enumeration of NE should hence proceed as follows:
Find the connected components of the graph, and then enumerate the cliques in it.

What Mark omitted in the GTE code (but not in my clique code which I posted at
https://github.com/stengel/standalone/blob/master/coclique3.c ) is the identification of connected components, on which it then makes sense to separately run the clique algorithm.

In order to compute the index via Anne Balthasar's thesis paper (chapter 2) one does not need the cliques at all (and in fact wants to avoid them so as to not count multiple times an extreme (x,y) that belongs to multiple cliques), only the connected component itself.

Now, we have two sets of data:

  1. the equilibria which come from vertex pairs; the information about the tableaux as they come from lrs is useful
    for the index computation (basis and cobasis variables representing the equilibria)
  2. the naming of these equilibria with numbers as input for the component/clique algorithm which needs to be fixed.

Where are these things to be found? In

https://github.com/gambitproject/gte/tree/master/lib-algo/src/lse/math/games/matrix

?

Bug: sometimes Lemke SF algo doesn't detect Imperfect Recall

As pointed by Bernhard, when running Lemke SF algorithm for the 'absent minded driver', gte enters an infinite loop. The reason behind that is probably that Lemke can't be used for games with imperfect recall, and that in this particular case it fails to detect that. The functionality that tests that is probably under gte/lib-algo/src/lse/math/games/treeSequenceForm.java.

An example of the absent minded game, which fails, is the following:

visualizing extensive-form strategies

A strategy in an extensive form (pure, pure reduced, behavior, behavior reduced) should be visually indicated for the player in the game tree, with e.g. arrows for deterministic moves, weighted arrows with (optional) indicated probability weights for behavior strategies, a star * for unspecified moves if the strategy is reduced.
Similarly for a strategy profile (one strategy for each player).
This touches on a wider issue: Designing a format for representing/storing strategies, equilibrium, asserting the equilibrium property, visualization of equilibria.
Should be an entire project: output visualization.

Stage arrows no longer aligned with buttons

The stage arrows
Tree > Players > Infosets > etc
should be above the icons underneath but are too far to the left, probably
the effect of removing the undo buttons. Need to be moved right.
Remedy: extra spacer of width 46 near line 1291 of
gui-builder/src/lse/math/games/builder/view/Main.mxml (1542 lines)

arrowalignment

File format for storing games

A new XML format for saving games, otherwise we have three formats floating around.
The main thing to change is to have a playerId 0,1,2 (or more if we have >2 players) stored with the player's NODE rather than the player name.
In the game tree, player are DISPLAYED by their names.
These are set at the beginning (if not, "1" and "2" as
default names).
Here we CURRENTLY HAVE

<players>
    <player playerId="1">1</player>
    <player playerId="2">2</player>
</players>

and it SHOULD BECOME (in order not to overload "player")

<players>
    <playername player="1">Alice</playername>
    <playername player="2">Bob</playername>
</players>

and in the rest of the data the only reference to a player for a node is via player, not the name of the player. This is how the game tree is logically processed.
Example:

<node iset="2" player="2" prob="1/2">
      <outcome move="l">
        <payoff player="1">5</payoff>
        <payoff player="2">2</payoff>
      </outcome>
      <outcome move="r">
        <payoff player="1">3</payoff>
        <payoff player="2">1</payoff>
      </outcome>
    </node>

Player names are irrelevant for the algorithms.

Whenever we refer to a player in the FILE, it should only be
via the player NUMBER which is
0 for chance
1 for player 1
2 for player 2
3 for player 3 etc. once more than
2 players are implemented.

This player number is what is used when assigning players to
nodes and payoffs. Examples:

 <node player="1" prob="1/2">
    <outcome move="A">
      <payoff player="1">0</payoff>
      <payoff player="2">0</payoff>
    </outcome>

Editing player names

Extensive form: The current naming of a player (with the animated triangle bouncing in from the right) is unintuitive, and does not behave well after the RETURN key. Clicking on the player IN THE GAME allows to change the name, just like move names. A corresponding small menu should pop up, like here:
playermenu

which allows to select the player (as currently highlighted: 1: Alice) and change of the player name (text) and would also be the place to change the player colour (only a few choices please). The tickbox "change text only here" would mean the change is local to the current info set or node (can be implemented later, and requires corresponding field in file format). The same menu (minus the tickbox) would pop up when clicking a second time on the "select player" mode button. Also new is naming the chance player (currently none). A "rotate players" or "swap first two players" operation would also have its input here.

In the strategic form, no naming of players is currently possible. The player name should appear like Player 1: Alice and allowed to be clicked on for changing.

unique transactions numbers for solver files

In order to make sure a solver solves the right game if several instances of GTE run simultaneously, need unique transaction numbers for each game that are appended to the file names for the solvers. They should probably be generated centrally on the server itself: i.e. first a request for a unique transaction number (generated "atomically" so it cannot be generated twice), then use of that transaction number to generate the filename (which is all the solver cares about). For several instances of GTE (including local ones), the transaction number should be from a separate block, e.g. 1000000-1999999 for GTE in Liverpool, 2000000-2999999 for LSE, 3000000-3999999 AWS. Maybe none (0 prefix) for testing and local, to keep them small? Maybe 1,000,000 max instances is a bit exaggerated, 100,000 (5 digits) should suffice.

game tree drawing - line thickness, leaf placement

In this example,

  • label of move B should be on the right,
  • leaf under B could be centered (better algo for placing leaves)
  • possibly offering MANUAL adjustment horizontally if not automatic (difficult)
  • move labels l,r a bit too close to lines
  • infoset line thickness should be allowed to be set separately from tree edge thickness

exta1-sf

xfig depths

for subsequent manipulation in xfig, there is currently a separate depth for each node, payoff, etc. There should be only one depth each for: payoffs, move labels, player labels, nodes, info sets, tree edges, to simply a central change like font or line thickness.
Current xfig depth generation is a kludge; xfig depth should be part of the object.

cookies (?) for remembering settings

User preferences such as line thickness, directory for storing games, export format could be remembered in cookies. While this is probably unnecessary (also invasion of privacy), or alternatively could be done via logins, there must be standard existing solutions that might be useful to learn. Related: store information about your users, and identify them (e.g. via IP address).

Parameters in extensive form

  • allow replacement of numerical values for chance probabilities and payoffs with parameters (same parameter may appear in more than place, probability p should be automatically complemented with remaining unknown probability such as 1-p if there are only two moves, or 1-p-q if there are three moves, with q as a new parameter or a constant; this suggests for chance moves only variables but not expressions should be allowed; for payoffs expressions may be possible).

    Parameter RANGES displayed separately on the side, such as p=1..4/5, for example (only numerator as separate integer). Then the game will be analyzed for all integers in the range, including singleton as range.

    Should the strategic form be COMPUTED SYMBOLICALLY in terms of these parameters? (Before solving it needs to be converted to numerical values for sure.)

Equilibrium output into file, not just into popup window

When the output from a computation in the pop-up window is
large (like >100kB), cut-and-paste via the window is very
slow with my editor, probably because the buffer is
(stupidly) paged to the disk or some other misconfiguration.
Can we add a "SAVE AS FILE" option - perhaps if this was a
browser window, it would be offered automatically?

Strategic Form and Matrix Layout merged into a single tab

Strategic form input should only be an input mode in the strategic form.
That is, we only want 2 tabs not 3 as now:
3tabs

The strategic form tab on the left should be the current matrix layout with (and this is the new thing) clickable entries.

Behavior:
Clicking on a single payoff only allows change of that payoff.

Clicking anywhere else in the cell pops up both payoffs separated by blanks.
Typing overwrites like on spreadsheet input (i.e. no highlight and delete necessary).
If only one number is input then the second number is left unchanged, or taken as the negative for zero-sum input.

Special keys when entering data: All the following conclude data entry, except for Esc which cancels:

  • Enter requires new clicking.
  • Tab goes to the next cell.
  • Shift-Tab goes to the previous cell.
  • Arrow-down and arrow-up (analogous to Tab and Shift-Tab) conclude entry and go to the cell below or above.
  • These do not terminate entry: Arrow-left and arrow-right navigate inside the cell.

upper envelope diagrams

For small games, show upper envelope of payoffs (possibly with some strategy weights fixed when there are too many pure strategies, to be investigated).
Possibly combine with manipulating the upper envelope, see http://www.maths.lse.ac.uk/Personal/stengel/UpperEnv.swf to create a game itself; that tool is written in flash and needs enhancement, e.g. snapping on integer values, and better generation of the corresponding game. Could be extended to best-response region display (which saves one dimension).
Perhaps part of a larger project: GTE as an educational tool for game theory.

game file name

a file name for the current game to be used for saves and exports, appearing as a title. This would behave with standard SAVE / SAVE AS look and feel.

Payoffs changing unexpectedly

The steps to reproduce it are as follows:

  • Configure GTE to allow 7 decimal digits
  • Save the following as a .xml file (I can't upload xml here). The game is zero-sum. Indeed, in the file, player2's payoffs are the negative of player1's:
<gte version="0.1">
  <gameDescription/>
  <display>
    <color player="1">#FF0000</color>
    <color player="2">#0000FF</color>
    <font>Times</font>
    <strokeWidth>1</strokeWidth>
    <cellVertPadding>5</cellVertPadding>
    <cellHorizPadding>5</cellHorizPadding>
  </display>
  <players>
    <player playerId="1">1</player>
    <player playerId="2">2</player>
  </players>
  <strategicForm size="{ 6 6 }">
    <strategy player="1">{ "A" "B" "C" "D" "E" "F" }</strategy>
    <strategy player="2">{ "a" "b" "c" "d" "e" "f" }</strategy>
    <payoffs player="1">0 0 -4237/50000 0 7353/125000 5597/125000
0 0 -4237/50000 0 7353/125000 5597/125000
42373/500000 42373/500000 0 42373/500000 142857/1000000 16129/125000
0 0 -4237/50000 0 7353/125000 5597/125000
-6569/100000 -6569/100000 -187/1250 -6569/100000 -689/100000 -209/10000
-229/10000 -229/10000 -10743/100000 -229/10000 3597/100000 2189/100000</payoffs>
    <payoffs player="2">0 0 4237/50000 0 -7353/125000 -5597/125000
0 0 4237/50000 0 -7353/125000 -5597/125000
-42373/500000 -42373/500000 0 -42373/500000 -142857/1000000 -16129/125000
0 0 4237/50000 0 -7353/125000 -5597/125000
6569/100000 6569/100000 187/1250 6569/100000 689/100000 209/10000
229/10000 229/10000 10743/100000 229/10000 -3597/100000 -2189/100000</payoffs>
  </strategicForm>
</gte>
  • Open that .xml file with GTE
  • Observe the third column of player 2
  • Now, click on decimal layout, then on 'general matrix'. Note that player2's payoff has changed.

Could this be 'confusing' the online solver?

disappearing player labels

In these pictures, drawn in natural order, a player's label disappear at the point of switching from stage "moves" to "payoffs".

disappear0
disappear1

Gambit for mac

I am trying to download Gambit on my computer, which is a mac, and it doesn't work. It downloads but when I am trying to open it afterwards, it fails to open and signals an error. All the people who are using a mac in my class have the same problem (for any version of Gambit). Is there anything we can do to solve this problem and be able to use Gambit for our courses ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.