egttools.behaviors.NormalForm.TwoActions.ActionInertia

class ActionInertia(self: egttools.numerical.numerical_.behaviors.NormalForm.TwoActions.ActionInertia, epsilon: SupportsFloat | SupportsIndex, p: SupportsFloat | SupportsIndex)

Bases: AbstractNFGStrategy

Strategy that tends to repeat its previous action.

Construct an ActionInertia strategy.

The strategy repeats its current action, but explores a different action with probability epsilon. In the first round it cooperates with probability p.

Parameters:
  • epsilon (float) – Probability of changing action.

  • p (float) – Probability of cooperation in the first round.

Methods

get_action

Return the action chosen by the strategy.

is_stochastic

Return whether the strategy is stochastic.

type

Return the strategy type.

__init__(self: egttools.numerical.numerical_.behaviors.NormalForm.TwoActions.ActionInertia, epsilon: SupportsFloat | SupportsIndex, p: SupportsFloat | SupportsIndex) None

Construct an ActionInertia strategy.

The strategy repeats its current action, but explores a different action with probability epsilon. In the first round it cooperates with probability p.

Parameters:
  • epsilon (float) – Probability of changing action.

  • p (float) – Probability of cooperation in the first round.

__new__(**kwargs)
get_action(self: egttools.numerical.numerical_.behaviors.NormalForm.TwoActions.ActionInertia, time_step: SupportsInt | SupportsIndex, action_prev: SupportsInt | SupportsIndex) int

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.TwoActions.ActionInertia) bool

Return whether the strategy is stochastic.

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

Return the strategy type.

__annotations__ = {}