forked from gambitproject/gambit
-
Notifications
You must be signed in to change notification settings - Fork 3
Indexing payoff table for strategic games #1
Copy link
Copy link
Open
Description
Strategic game outcomes can be obtained via indexing using the __getitem__ operator. This takes a tuple of entries, one for each player, in the order in which players appear in the list of players, and returns an outcome.
The initial implementation supports indexing via integers, corresponding to the index of the strategy in each player's strategy set.
- Enhancement: Support indexing by strategy labels (text strings). If a player has a duplicate strategy label, raise a suitable exception. (That is, it is up to the user to keep a player's strategy labels unique.)
- Enhancement: Support indexing by strategies. Accept a strategy object in place of an integer or text string. The strategy needs to belong to the appropriate player, otherwise an exception should be raised.
- Additional test cases: Ensure that unexpected input (tuples with the wrong number of arguments, tuples with unexpected object types, etc.) raises appropriate exceptions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels