Evaluate

A collection of functions for evaluating strategies given a game.

imperfecto.misc.evaluate.evaluate_strategies(Game, strategies, n_iters)[source]

Evaluates a set of strategies on a game.

Parameters
  • Game (Type[ExtensiveFormGame]) – The game class to evaluate the strategies on (e.g., RockPaperScissorGame).

  • strategies (Sequence[dict]) –

    A list of strategies, one strategy per each player in the game. Example:

    player0_strat = {"P0": [1/3, 1/3, 1/3]} # equally likely rock-paper-scissor
    player1_strat = {"P1": [0.4, 0.4, 0.2]}
    strategies = [player0_strat, player1_strat]
    

  • n_iters (int) – The number of iterations to run the game for.

Return type

Sequence[float]

Returns

A list of the average payoffs of each strategy.