gambitproject / gte Goto Github PK
View Code? Open in Web Editor NEWGame Theory Explorer: Build, explore and solve extensive form games.
License: GNU General Public License v3.0
Game Theory Explorer: Build, explore and solve extensive form games.
License: GNU General Public License v3.0
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
.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.)
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.
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:
undo
button.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.
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.
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.
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.
"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.)
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.
Resize strategic form automatically if you have switched from the extensive form
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:
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:
Where are these things to be found? In
https://github.com/gambitproject/gte/tree/master/lib-algo/src/lse/math/games/matrix
?
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:
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.
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)
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>
current installation instructions go in detail for ECLIPSE, which should be separate for those that don't use ECLIPSE and just want to compile and run
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:
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.
trying to add video. not working
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.
In this example,
"LOAD game" seems to remember the last directory, but
"SAVE game" does not.
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.
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).
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.)
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?
If the root is deleted, unwanted things occur
So far, when merging info sets does not work, there is no visible feedback.
Strategic form input should only be an input mode in the strategic form.
That is, we only want 2 tabs not 3 as now:
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.Arrow-left
and arrow-right
navigate inside the cell.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.
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.
The steps to reproduce it are as follows:
<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>
Could this be 'confusing' the online solver?
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 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.