egttools.behaviors.CRD.moving_average.MovingAverageCRDStrategy¶
- class MovingAverageCRDStrategy(a0, aa, am, ab, group_size)[source]¶
Bases:
AbstractCRDStrategy
A CRD strategy which adapts in function of a moving average of the contributions of the rest of the group.
- Parameters
a0 (int) – how much to contribute in the initial round.
aa (int) – how much to contribute when you have contributed above the average of the group in the previous round.
am (int) – how much to contribute when you have contributed equal to the average of the group in the previous round.
ab (int) – how much to contribute when you have contributed below the average of the group in the previous round.
group_size (int) – Size of the group.
Methods
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__(a0, aa, am, ab, group_size)[source]¶
A CRD strategy which adapts in function of a moving average of the contributions of the rest of the group.
- Parameters
a0 (int) – how much to contribute in the initial round.
aa (int) – how much to contribute when you have contributed above the average of the group in the previous round.
am (int) – how much to contribute when you have contributed equal to the average of the group in the previous round.
ab (int) – how much to contribute when you have contributed below the average of the group in the previous round.
group_size (int) – Size of the group.
- __new__(**kwargs)¶
- get_action(time_step, group_contributions_prev)[source]¶
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.CRDMemoryOnePlayer
,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.TTFT
,egttools.behaviors.NormalForm.TwoActions.GRIM
,egttools.behaviors.NormalForm.TwoActions.Pavlov
- type(self: egttools.numerical.numerical.behaviors.CRD.AbstractCRDStrategy) str [source]¶
Returns a string indicating the Strategy Type.