0

本质上,我想创建一个信任游戏,让我(或我研究团队中的其他人)在每一轮中扮演受托人的角色。

我从基本的信任游戏代码开始:

class Constants(BaseConstants):
    name_in_url = 'my_trust'
    players_per_group = 2
    num_rounds = 1

    endowment = cu(10)
    multiplication_factor = 3
class Group(BaseGroup):

    sent_amount = models.CurrencyField(
        label="How much do you want to send to participant B?"
    )
    sent_back_amount = models.CurrencyField(
        label="How much do you want to send back?"
    )
class Send(Page):

    form_model = 'group'
    form_fields = ['sent_amount']

    @staticmethod
    def is_displayed(player):
        return player.id_in_group == 1
class SendBack(Page):

    form_model = 'group'
    form_fields = ['sent_back_amount']

    @staticmethod
    def is_displayed(player):
        return player.id_in_group == 2

    @staticmethod
    def vars_for_template(player):
        group = player.group

        return dict(
            tripled_amount=group.sent_amount * Constants.multiplication_factor
        )

但是,这当然会将参与者分配到两个角色之一,并让他们与其他参与者而不是我或我的团队一起玩游戏。有关如何实施此结构的任何建议?

4

0 回答 0