1
0
mirror of https://github.com/balkian/gists.git synced 2024-09-27 15:51:42 +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()
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:
if random.random() < self.prob_infect:
neighbor.state['id'] = self.INFECTED