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:
AbstractCRDStrategyThis 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
See also
egttools.behaviors.CRD.AbstractCRDStrategy,egttools.games.AbstractGame,egttools.games.CRDGame,egttools.games.CRDGameTUMethods
Returns an action in function of time_step round and the previous action action_prev of the opponent.
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)¶
- 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:
- Returns:
The action selected by the strategy.
- Return type:
See also
egttools.behaviors.CRD.AbstractCRDStrategy,egttools.games.AbstractGame,egttools.games.CRDGame,egttools.games.CRDGameTU,egttools.behaviors.NormalForm.TwoActions.Cooperator,egttools.behaviors.NormalForm.TwoActions.Defector,egttools.behaviors.NormalForm.TwoActions.Random,egttools.behaviors.NormalForm.TwoActions.TFT,egttools.behaviors.NormalForm.TwoActions.SuspiciousTFT,egttools.behaviors.NormalForm.TwoActions.GenerousTFT,egttools.behaviors.NormalForm.TwoActions.GradualTFT,egttools.behaviors.NormalForm.TwoActions.ImperfectTFT,egttools.behaviors.NormalForm.TwoActions.TFTT,egttools.behaviors.NormalForm.TwoActions.TFTT,egttools.behaviors.NormalForm.TwoActions.GRIM
- type(self: egttools.numerical.numerical_.behaviors.CRD.CRDMemoryOnePlayer) str¶
Returns a string indicating the Strategy Type.
- __annotations__ = {}¶