epidemioptim/environments/gym_envs/epidemic_vaccination_16.py
def compute_sigma_with_action(self, action):
        """
        Compute the vaccination rate (same as in the model)
        """
        mwl = self.model.mitigation_windows[self.model.step-1]
        lowVP = 1
        pi = lowVP*(self.model.vaccination_coverage[self.model.vacStep]/100)
        popGrp = ['S1', 'S2', 'S3', 'S4', 'E21', 'E22', 'E23', 'E31', 'E32', 'E33', 'E41', 'E42', 
                  'E43', 'V11', 'V21', 'V31', 'V41', 'V12', 'V22', 'V32', 'V42', 'I2', 'I3', 'I4']
        sigma = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        wcv, Ntot = 0, 0
        for n in range(16):
            Ntot += sum([self.model.current_state[self.model._age_groups[n]]['{}'.format(s)] for s in popGrp])
        for n in range(16):
            if action[n] == 1:
                wcv += self.get_S_pop_vaccine_groups()[n]
        g = (pi*Ntot/wcv)
        if g>1:
            g=0.99999999
        sig = 1/mwl*(-math.log(1-g))
        for k in range(16):
            if action[k] == 1:
                sigma[k] = sig
            if sigma[k] < 0:
                sigma[k] = 0
        total_pop = self.get_total_pop_vaccine_groups()
        dcv1, threshold = self.get_dcv1_and_threshold()
        for f in range(16):
            size = total_pop[f]
            if dcv1[f]/size >= threshold[f]/0.8944:
                sigma[f] = 0
        return sigma

        Compute the vaccination rate (same as in the model)
        
Compute the vaccination rate (same as in the model)
Compute the vaccination rate ( same as in the model )
def compute_sigma_with_action(self, action):
        mwl = self.model.mitigation_windows[self.model.step-1]
        lowVP = 1
        pi = lowVP*(self.model.vaccination_coverage[self.model.vacStep]/100)
        popGrp = ['S1', 'S2', 'S3', 'S4', 'E21', 'E22', 'E23', 'E31', 'E32', 'E33', 'E41', 'E42', 
                  'E43', 'V11', 'V21', 'V31', 'V41', 'V12', 'V22', 'V32', 'V42', 'I2', 'I3', 'I4']
        sigma = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        wcv, Ntot = 0, 0
        for n in range(16):
            Ntot += sum([self.model.current_state[self.model._age_groups[n]]['{}'.format(s)] for s in popGrp])
        for n in range(16):
            if action[n] == 1:
                wcv += self.get_S_pop_vaccine_groups()[n]
        g = (pi*Ntot/wcv)
        if g>1:
            g=0.99999999
        sig = 1/mwl*(-math.log(1-g))
        for k in range(16):
            if action[k] == 1:
                sigma[k] = sig
            if sigma[k] < 0:
                sigma[k] = 0
        total_pop = self.get_total_pop_vaccine_groups()
        dcv1, threshold = self.get_dcv1_and_threshold()
        for f in range(16):
            size = total_pop[f]
            if dcv1[f]/size >= threshold[f]/0.8944:
                sigma[f] = 0
        return sigma
def compute_sigma_with_action ( self , action ) : mwl = self . model . mitigation_windows [ self . model . step - 1 ] lowVP = 1 pi = lowVP * ( self . model . vaccination_coverage [ self . model . vacStep ] / 100 ) popGrp = [ 'S1' , 'S2' , 'S3' , 'S4' , 'E21' , 'E22' , 'E23' , 'E31' , 'E32' , 'E33' , 'E41' , 'E42' , 'E43' , 'V11' , 'V21' , 'V31' , 'V41' , 'V12' , 'V22' , 'V32' , 'V42' , 'I2' , 'I3' , 'I4' ] sigma = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] wcv , Ntot = 0 , 0 for n in range ( 16 ) : Ntot += sum ( [ self . model . current_state [ self . model . _age_groups [ n ] ] [ '{}' . format ( s ) ] for s in popGrp ] ) for n in range ( 16 ) : if action [ n ] == 1 : wcv += self . get_S_pop_vaccine_groups ( ) [ n ] g = ( pi * Ntot / wcv ) if g > 1 : g = 0.99999999 sig = 1 / mwl * ( - math . log ( 1 - g ) ) for k in range ( 16 ) : if action [ k ] == 1 : sigma [ k ] = sig if sigma [ k ] < 0 : sigma [ k ] = 0 total_pop = self . get_total_pop_vaccine_groups ( ) dcv1 , threshold = self . get_dcv1_and_threshold ( ) for f in range ( 16 ) : size = total_pop [ f ] if dcv1 [ f ] / size >= threshold [ f ] / 0.8944 : sigma [ f ] = 0 return sigma
Compute the vaccination rate (same as in the model)
Compute the vaccination rate ( same as in the model )
"""
        Compute the vaccination rate (same as in the model)
        """
self
action