egttools.behaviors.CRD.CRDMemoryOnePlayer

class CRDMemoryOnePlayer(self: egttools.numerical.numerical.behaviors.CRD.CRDMemoryOnePlayer, personal_threshold: int, initial_action: int, action_above: int, action_equal: int, action_below: int)

Bases: AbstractCRDStrategy

This strategy contributes in function of the contributions of the rest of the group in the previous round.

This strategy contributes @param initial_action in the first round of the game, afterwards compares the sum of contributions of the other members of the group in the previous round (a_{-i}(t-1)) to a :param personal_threshold. If the a_{-i}(t-1)) > personal_threshold the agent contributions :param action_above, if a_{-i}(t-1)) = personal_threshold it contributes :param action_equal or if a_{-i}(t-1)) < personal_threshold it contributes :param action_below.

Parameters
  • personal_threshold (int) – threshold value compared to the contributions of the other members of the group

  • initial_action (int) – Contribution in the first round

  • action_above (int) – contribution if a_{-i}(t-1)) > personal_threshold

  • action_equal (int) – contribution if a_{-i}(t-1)) = personal_threshold

  • action_below (int) – contribution if a_{-i}(t-1)) < personal_threshold

Methods

get_action

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

type

Returns a string indicating the Strategy Type.

__init__(self: egttools.numerical.numerical.behaviors.CRD.CRDMemoryOnePlayer, personal_threshold: int, initial_action: int, action_above: int, action_equal: int, action_below: int) None

This strategy contributes in function of the contributions of the rest of the group in the previous round.

This strategy contributes @param initial_action in the first round of the game, afterwards compares the sum of contributions of the other members of the group in the previous round (a_{-i}(t-1)) to a :param personal_threshold. If the a_{-i}(t-1)) > personal_threshold the agent contributions :param action_above, if a_{-i}(t-1)) = personal_threshold it contributes :param action_equal or if a_{-i}(t-1)) < personal_threshold it contributes :param action_below.

Parameters
  • personal_threshold (int) – threshold value compared to the contributions of the other members of the group

  • initial_action (int) – Contribution in the first round

  • action_above (int) – contribution if a_{-i}(t-1)) > personal_threshold

  • action_equal (int) – contribution if a_{-i}(t-1)) = personal_threshold

  • action_below (int) – contribution if a_{-i}(t-1)) < personal_threshold

__new__(**kwargs)
__str__(self: egttools.numerical.numerical.behaviors.CRD.CRDMemoryOnePlayer) str
get_action(self: egttools.numerical.numerical.behaviors.CRD.CRDMemoryOnePlayer, time_step: int, group_contributions_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.

  • group_contributions_prev (int) – Sum of contributions of the other members of the group (without the focal player) in the previous round.

Returns

The action selected by the strategy.

Return type

int

type(self: egttools.numerical.numerical.behaviors.CRD.CRDMemoryOnePlayer) str

Returns a string indicating the Strategy Type.