def test_is_not_quarantined(self): header("Running test_is_not_quarantined") # default max social dist is ep.DEF_DISTANCING unit. self.env.place_member(self.sal, xy=(0, 0)) self.env.place_member(self.azi, xy=(0, ep.DEF_DISTANCING // 2)) debug_agent_pos(self.sal) debug_agent_pos(self.azi) self.assertFalse(ep.is_isolated(self.azi))
def test_close_contagion_action(self): # Will agents move away if they are are not isolated header("Running test_is_infecting") # default max social dist is ep.DEF_DISTANCING unit. close = ep.DEF_DISTANCING // 2 self.env.place_member(self.sal, xy=(0, 0)) self.env.place_member(self.azi, xy=(0, close)) debug_agent_pos(self.sal) self.assertIs(ep.MOVE, ep.person_action(self.sal))
def test_is_quarantined(self): header("Running test_is_quarantined") # default max social dist is ep.DEF_DISTANCING unit. far_away = ep.DEF_DISTANCING * 2 self.env.place_member(self.sal, xy=(0, 0)) self.env.place_member(self.azi, xy=(0, far_away)) debug_agent_pos(self.sal) debug_agent_pos(self.azi) self.assertTrue( ep.is_isolated(self.azi), "agent is " + str(far_away) + " units away but is not quarantined.")
def test_is_infecting(self): # are the contagious agents successfully infecting the healthy? header("Running test_is_infecting") # default max social dist is ep.DEF_DISTANCING unit. close = ep.DEF_DISTANCING // 2 self.env.place_member(self.sal, xy=(0, 0)) self.env.place_member(self.azi, xy=(0, close)) debug_agent_pos(self.sal) ep.person_action(self.sal) ep.person_action(self.azi) self.assertFalse( ep.is_healthy(self.azi), "agent is " + str(close) + " units away from a contagious agent" + " but is not exposed")
def test_dead_action(self): # dead_people shoudn't move header("Running test_dead_action ") self.env.place_member(self.sal, xy=(0, 0)) debug_agent_pos(self.bob) self.assertIs(ep.DONT_MOVE, ep.person_action(self.bob))