Open skranz opened 9 years ago
This is indeed a useful idea and I have thought about doing something similar. I have been thinking in a different direction, however - rather than sticking with comma-separated I've been thinking about some other sort of formats for automated processing.
Are you thinking about probability distributions over outcomes or terminal nodes? In Gambit, these are different concepts. I don't think distributions over outcomes are (directly) implemented anywhere, but realisation probabilities for nodes certainly are.
An alternative approach would be to use the Python interface instead, which allows access to all information about computed strategy profiles (without having to worry about trying to figure out the mapping between entries in the CSV and objects in the game).
Certainly no need to apologise. Gambit's distinction between outcome and terminal node is quite useful, but it not the convention that all authors follow; so I wanted to be sure I understood the question.
If one wants to represent all of the data in a behaviour or strategy profile, I do think something more structured is indicated. Formats like JSON and/or YAML are logical, because most users can parse those with one line of code given a suitable library, making a lot more sense than having to write custom parsing code. The issue would be in having the right data model; once that's in place, serialisation is of course straightforward.
Q on the original suggestion: "easily parsed" for humans or machines? For the latter, XML seems appropriate (and we have to decide on the format), for humans some conversion from that format may be the way.
I mean easily parsed by a computer. Or more precisely, it shall be easy for a programmer to import the data. I guess XML, JSON and YAML would probably all do the job fine. That being said, I personally find it considerably easier to import JSON (or YAML) from R than to import XML. Probably that is because XML has too much flexibility, so one must know more about the specifics of the format than for JSON. That it is easier human readable would just be a nice side effect of JSON and YAML.
I do think that stampeding towards XML or any particular format is premature. It is more important to understand what the data model is. Then, it would be trivial to export that model as XML, JSON, and YAML, with the user deciding which they prefer. I would expect JSON would be most popular followed by YAML, as they require much less coding overhead to manipulate. JSON and YAML both have native support for key-value mappings and sequences, which are the most natural way to express the information.
First of all, thanks to all contributors to Gambit.
I wanted to ask if it would be possible to augment the command line tools for flags that allow to show in addition to the equilibria the following elements (in a table like manner that can be easily parsed):
For example, consider the following game with 3 nodes in which player 1 moves at node 1 and player 2 at nodes 2 and 3:
The output for one equilibrium in which player 1 mixes equally between the two actions in the first node could look as follows if all three flags are turned on:
(Since all information sets are singleton, the beliefs are trivial here). In particular, the option to see the probabilities over outcomes would be really useful.