Skip to content

Commit

Permalink
Merge pull request #164 from ggrrll/master
Browse files Browse the repository at this point in the history
improved & fixed  v. of  E > I transition
  • Loading branch information
GiulioRossetti committed May 19, 2020
2 parents dea8c6e + 77be272 commit 9e80267
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ndlib/models/epidemics/SEIRModel.py
Expand Up @@ -79,23 +79,18 @@ def iteration(self, node_status=True):
if self.params['model']['tp_rate'] == 1:
if eventp < 1 - (1 - self.params['model']['beta']) ** len(infected_neighbors):
actual_status[u] = 2 # Exposed
self.progress[u] = 0
self.progress[u] = self.actual_iteration # save time of exposure t_i
else:
if eventp < self.params['model']['beta'] * triggered:
actual_status[u] = 2 # Exposed
self.progress[u] = 0
self.progress[u] = self.actual_iteration # save time of exposure t_i

elif u_status == 2:

# not sure whether this line is correct – to be tested
if eventp < 1 - np.exp(- self.actual_iteration / self.params['model']['alpha']):
actual_status[u] = 1 # Infected

# if self.progress[u] < 1:
# self.progress[u] += self.params['model']['alpha']
# else:
# actual_status[u] = 1 # Infected
# del self.progress[u]
# apply prob. of infection, after (t - t_i)
if eventp < 1 - np.exp(- (self.actual_iteration - self.progress[u]) / self.params['model']['alpha']):
actual_status[u] = 1 # Infected
del self.progress[u]

elif u_status == 1:
if eventp < self.params['model']['gamma']:
Expand Down

0 comments on commit 9e80267

Please sign in to comment.