Skip to content

Game classification #1414

@alexhroom

Description

@alexhroom

Following up from #1413, to ensure strategies and algorithms are being used with compatible games there should be a method of classifying and organising games.

Some ideas:

  • a 'games' directory in the package, which contains a sort of 'mini-package' for a specific game. For example, the import path axelrod.games.rockpaperscissors would contain a Game, Actions and Strategy objects for rock-paper-scissors.
  • Maybe for convenience, the axelrod.games directory could contain a function where a user enters a game name and it returns a dict with the various components of the game, e.g.:
>>> from axelrod.games import get_game
>>> get_game("rock_paper_scissors")
{"game": axl.AsymmetricGame([RPS MATRICES HERE]),
 "actions": [R, P, S],
 "strategies": [[RPS STRATEGIES HERE]]
}
  • Strategies themselves should have classifications for what action set size they're for, and raise an error or warning if used on an inappropriate game size.
  • If we're worried about the package getting too big with more games/strategies it may be a good idea to use namespace packages so that other games can be installed separately but used from the axelrod namespace - particularly if a few games are added before the release of 5.0.0 this would be a good way to "generalise" the library completely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions