oTree Forum >

Accessing randomly generated numbers

#1 by simsonmez

Hello! 

In my experiment, I am trying to simulate a doctor's waiting room. How can I access the randomly generated number: "waiting_time" at the end with all other data? That's what the Waiting Room page looks like:

class WaitingArea(Page):
    @staticmethod
    def js_vars(player):
        return dict(
            waiting_time=random.uniform(1, 21) if player.chosen_clinic == 1 else random.uniform(11, 12)
        )
    
Many thanks for considering my request.

Best,

Simge

Write a reply

Set forum username