Duculet / EmbodiedAI

Repository for the Emobided AI course at Vrije Universiteit Amsterdam 2020
0 stars 0 forks source link

Randomness for incubation period #1

Open jvdburgt opened 3 years ago

jvdburgt commented 3 years ago

I added some randomness to the incubation period (second line if-statement):

    if self.infection_timer > config["person"]["incubation_period"]:
        if config["person"]["p_onset"] > np.random.random():
            self.image.fill('red')
            if self.p_dead > np.random.random():
                self.type = 'D'
                self.image.fill('pink')
                self.image.set_alpha(100)
                new_state = 'dead'
            elif self.p_quarantine > np.random.random():
                # Quarantine
                self.pos = np.array([500.0, 150.0])
                self.type = 'Q'
            self.p_dead = 0
            self.p_quarantine = 0