Skip to content

Extra or missing payoffs or outcomes in NFG savefiles #119

@tturocy

Description

@tturocy

Historically, Gambit has accepted silently strategic game save files where the number of payoffs (or outcomes, depending on the style) does not match with the number of contingencies in the game. Long ago there were reasons of convenience for doing this, but now - when there are many tools to help automate creation of files, not to mention a stronger Gambit API for doing so - experience is that this causes confusion with unexpected behaviours with files created by users which accidentally have too many/too few payoffs.

  • The parsers for both payoff-based and outcome-based files should be updated to raise exceptions both if not enough payoffs/outcomes are specified, or if too many are.
  • Test cases should be added to the Python library in src/python/gambit/tests to confirm the new behaviour.
  • Documentation doc/formats.rst should be updated to reflect this with an appropriate "New in Gambit 14" note.
  • It should be confirmed that all games in contrib/games/*.nfg parse correctly once the change is made - these should all be valid NFG files, but there is always some chance some of them are in fact invalid by this new standard!

As this is a potential change in behaviour, this should be undertaken relative to the master branch. Some discussion may need to be had with users to confirm this is a good idea before shipping, as this would potentially break user code that somehow relies on this feature.

Metadata

Metadata

Assignees

Labels

c++Items which involve writing in C++enhancementpythonItems which involve coding in Python

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions