I would like to define a parameter variable via the default attribute id_in_group of the player. However, this attribute does not seem to be accessible via the ways I could think of (such as via BasePlayer.id_in_group).
The code of the class player:
class Player(BasePlayer):
investment_amount = models.CurrencyField(
doc="""
Amount invested by this player.
""",
min=0, max=Constants.endowment
)
random_number = BasePlayer.id_in_group
def set_payoffs(self):
for p in self.get_players():
p.payoff = 110
How could I access the attribute id_in_group? Or is it impossible due to the fact that it is a default attribute preset by oTree?