ncsa/COVID19-mesa

First chance to be infected logic

Opened this issue · 0 comments

For a SUSCEPTIBLE to become EXPOSED when checking the cellmates, it would seem that:

  • the self agent needs to either not be in isolation or be in ineffective isolation,
  • and the cellmate also needs to either not be in isolation or be in ineffective isolation,
  • and of course, the cellmate must be contagious.

However, in the code below, it doesn't appear that the cellmates isolation status is ever checked, and instead the self's isolation status is repeatedly checked (though it really only needs to be checked once before the main loop even starts). Am I missing something?

            # Isolated people should only be contagious if they do not follow proper
            # shelter-at-home measures
            for c in cellmates:
                    if c.is_contagious():
                        c.add_contact_trace(self)
                        if self.isolated and bernoulli.rvs(1 - self.model.prob_isolation_effective):
                            self.isolated_but_inefficient = True
                            infected_contact = True
                            break
                        else:
                            infected_contact = True
                            break