1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-21 17:22:29 +00:00
This commit is contained in:
J. Fernando Sánchez 2017-06-20 11:50:22 +02:00 committed by GitHub
parent afebf97965
commit 2798757188

View File

@ -8,7 +8,7 @@ class ControlModelM2(BaseBehaviour):
self.infected_behaviour() self.infected_behaviour()
def infected_behaviour(self): def infected_behaviour(self):
neutral_neighbors = self.get_neighboring_agents(state_id=0) neutral_neighbors = self.get_neighboring_agents(state_id=self.NEUTRAL)
for neighbor in neutral_neighbors: for neighbor in neutral_neighbors:
if random.random() < self.prob_infect: if random.random() < self.prob_infect:
neighbor.state['id'] = self.INFECTED neighbor.state['id'] = self.INFECTED