Exemplo n.º 1
0
 def initialize(self, sim):
     sim.results.update({'n_dose_0': cvb.Result('No doses', npts=sim['n_days'] + 1,
                                                      scale=True)})
     sim.results.update({'n_dose_1': cvb.Result('1 dose', npts=sim['n_days'] + 1,
                                                      scale=True)})
     sim.results.update({'n_dose_2': cvb.Result('2 dose', npts=sim['n_days'] + 1,
                                                      scale=True)})
     self.initialized = True
     return
Exemplo n.º 2
0
    def initialize(self, sim):
        ''' Fix the dates and store the vaccinations '''
        # Handle days
        self.start_day   = sim.day(self.start_day)
        self.end_day     = sim.day(self.end_day)
        self.days        = [self.start_day, self.end_day]

        # Process daily data
        self.daily_vaccines = process_daily_data(self.daily_vaccines, sim, self.start_day)

        # Ensure we have the dose scheduler
        flag = True
        for intv in sim['interventions']:
            if isinstance(intv, dose_scheduler):
                flag = False
        if flag:
            sim['interventions'] += [dose_scheduler()]

        # Save
        self.orig_rel_trans    = sc.dcp(sim.people.rel_trans) # Keep a copy of pre-vaccination transmission
        self.orig_symp_prob    = sc.dcp(sim.people.symp_prob) # ...and symptom probability

        # Initialize vaccine info
        self.vaccinations = np.zeros(sim.n, dtype=cvd.default_int)
        self.vaccine_take = np.zeros(sim.n, dtype=np.bool)
        self.vaccination_dates = [[] for p in range(sim.n)]  # Store the dates when people are vaccinated
        sim.results['new_doses'] = cvb.Result(name='New Doses', npts=sim['n_days']+1, color='#ff00ff')
        self.initialized = True

        return
Exemplo n.º 3
0
 def initialize(self, sim):
     sim.results.update({
         'new_doses':
         cvb.Result('New doses', npts=sim['n_days'] + 1, scale=True)
     })
     self.initialized = True
     return
Exemplo n.º 4
0
    def init_results(self):
        '''
        This is a modification of the superclass function. Mostly it calls the super class function, but
        it creates a new stock channel.        
        '''
        super().init_results()

        #Create a new stock channel to record the number of students in quaratine *or* isolation; the color is shared
        #   with quarantined.
        self.results["n_quarantineDorm"] = cvb.Result(name="n_quarantineDorm",
                                                      npts=self.npts,
                                                      scale='dynamic',
                                                      color='#5f1914')

        return