egttools.behaviors.NormalForm.TwoActions.GradualTFT

class GradualTFT(self: egttools.numerical.numerical.behaviors.NormalForm.TwoActions.GradualTFT)

Bases: AbstractNFGStrategy

TFT with two differences: (1) it increases the string of punishing defection responses with each additional defection by its opponent (2) it apologizes for each string of defectionsby cooperating in the subsequent two rounds.

Methods

get_action

Returns an action in function of time_step round and the previous action action_prev of the opponent.

is_stochastic

Indicates whether the strategy is stochastic.

type

Returns a string indicating the Strategy Type.

__init__(self: egttools.numerical.numerical.behaviors.NormalForm.TwoActions.GradualTFT) None

TFT with two differences: (1) it increases the string of punishing defection responses with each additional defection by its opponent (2) it apologizes for each string of defectionsby cooperating in the subsequent two rounds.

__new__(**kwargs)
get_action(self: egttools.numerical.numerical.behaviors.NormalForm.TwoActions.GradualTFT, time_step: int, action_prev: int) int

Returns an action in function of time_step round and the previous action action_prev of the opponent.

Parameters
  • time_step (int) – Current round.

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

Returns

The action selected by the strategy.

Return type

int

is_stochastic(self: egttools.numerical.numerical.behaviors.NormalForm.TwoActions.GradualTFT) bool

Indicates whether the strategy is stochastic.

type(self: egttools.numerical.numerical.behaviors.NormalForm.TwoActions.GradualTFT) str

Returns a string indicating the Strategy Type.