Skip to content

Indexing payoff table for strategic games #1

@tturocy

Description

@tturocy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions