egttools.behaviors.CRD.time_based.TimeBasedCRDStrategy

class TimeBasedCRDStrategy(actions_per_round)[source]

Bases: AbstractCRDStrategy

A CRD strategy which adapts in function of a moving average of the contributions of the rest of the group.

Parameters

actions_per_round (List[int]) – Defines the action which this strategy will play in every round. If you change the number of rounds of the game, you should redefine this list, otherwise there will be an exception!!

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__(actions_per_round)[source]

A CRD strategy which adapts in function of a moving average of the contributions of the rest of the group.

Parameters

actions_per_round (List[int]) – Defines the action which this strategy will play in every round. If you change the number of rounds of the game, you should redefine this list, otherwise there will be an exception!!

__new__(**kwargs)
__str__()[source]

Return str(self).

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
  • time_step (int) – Current round.

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

Returns

The action selected by the strategy.

Return type

int

type(self: egttools.numerical.numerical.behaviors.CRD.AbstractCRDStrategy) str[source]

Returns a string indicating the Strategy Type.