egttools.behaviors.NormalForm.TwoActions.EpsilonGRIM

class EpsilonGRIM(p, epsilon)[source]

Bases: AbstractNFGStrategy

A GRIM player with randomized first action and probability of making mistakes.

This player acts exactly as GRIM (cooperates until the opponent defects), however in the first round it will cooperate with probability :param p and in the subsequent rounds it has a probability :param epsilon of making a mistake and changing its action.

Parameters:
  • p (float) – Probability of cooperating in the first round

  • epsilon (float) – Probability of making a mistake in any round after round 1.

Methods

get_action

Return the action chosen by the strategy.

is_stochastic

Return whether the strategy is stochastic.

type

Return the strategy type.

__init__(p, epsilon)[source]

A GRIM player with randomized first action and probability of making mistakes.

This player acts exactly as GRIM (cooperates until the opponent defects), however in the first round it will cooperate with probability :param p and in the subsequent rounds it has a probability :param epsilon of making a mistake and changing its action.

Parameters:
  • p (float) – Probability of cooperating in the first round

  • epsilon (float) – Probability of making a mistake in any round after round 1.

__new__(**kwargs)
__str__()[source]

Return str(self).

get_action(time_step, action_prev)[source]

Return the action chosen by the strategy.

Parameters:
  • time_step (int) – Current round.

  • action_prev (int) – Previous action of the opponent.

Returns:

Action selected by the strategy.

Return type:

int

is_stochastic(self: egttools.numerical.numerical_.behaviors.NormalForm.AbstractNFGStrategy) bool[source]

Return whether the strategy is stochastic.

type(self: egttools.numerical.numerical_.behaviors.NormalForm.AbstractNFGStrategy) str[source]

Return the strategy type.

__annotations__ = {}