epidemioptim/environments/models/heffernan_ode_model_16.py
def compute_sigma(self):
        """
        Computes sigma, the vaccination rate, regarding for each group if they are eligible to vaccination during a time period
        """
        mwl = self.mitigation_windows[self.step]
        lowVP = 1
        pi = lowVP*(self.vaccination_coverage[self.vacStep]/100)
        classes = ['S1', 'S2', 'S3', 'S4']
        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.current_state[self._age_groups[n]]['{}'.format(s)] for s in popGrp])
            if self.whovaccinated[self.vacStep][n] == 1:
                wcv += sum([self.current_state[self._age_groups[n]]['{}'.format(y)] for y in classes])
        g = (pi*Ntot/wcv)
        if g>1:
            g=0.999999999
        for k in range(16):
            if self.whovaccinated[self.vacStep+1][k] == 1:
                sigma[k] = 1/mwl*(-math.log(1-g))
            if sigma[k] < 0:
                sigma[k] = 0
        for f in range(16):
            size = sum([self.current_state[self._age_groups[f]]['{}'.format(s)] for s in popGrp])
            if self.dCV1[f]/size >= self.coverage_threshold[f]/0.8944:
                sigma[f] = 0
        if self.t > 670:
            return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        return sigma

        Computes sigma, the vaccination rate, regarding for each group if they are eligible to vaccination during a time period
        
Computes sigma, the vaccination rate, regarding for each group if they are eligible to vaccination during a time period
Computes sigma the vaccination rate regarding for each group if they are eligible to vaccination during a time period
def compute_sigma(self):
        mwl = self.mitigation_windows[self.step]
        lowVP = 1
        pi = lowVP*(self.vaccination_coverage[self.vacStep]/100)
        classes = ['S1', 'S2', 'S3', 'S4']
        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.current_state[self._age_groups[n]]['{}'.format(s)] for s in popGrp])
            if self.whovaccinated[self.vacStep][n] == 1:
                wcv += sum([self.current_state[self._age_groups[n]]['{}'.format(y)] for y in classes])
        g = (pi*Ntot/wcv)
        if g>1:
            g=0.999999999
        for k in range(16):
            if self.whovaccinated[self.vacStep+1][k] == 1:
                sigma[k] = 1/mwl*(-math.log(1-g))
            if sigma[k] < 0:
                sigma[k] = 0
        for f in range(16):
            size = sum([self.current_state[self._age_groups[f]]['{}'.format(s)] for s in popGrp])
            if self.dCV1[f]/size >= self.coverage_threshold[f]/0.8944:
                sigma[f] = 0
        if self.t > 670:
            return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        return sigma
def compute_sigma ( self ) : mwl = self . mitigation_windows [ self . step ] lowVP = 1 pi = lowVP * ( self . vaccination_coverage [ self . vacStep ] / 100 ) classes = [ 'S1' , 'S2' , 'S3' , 'S4' ] 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 . current_state [ self . _age_groups [ n ] ] [ '{}' . format ( s ) ] for s in popGrp ] ) if self . whovaccinated [ self . vacStep ] [ n ] == 1 : wcv += sum ( [ self . current_state [ self . _age_groups [ n ] ] [ '{}' . format ( y ) ] for y in classes ] ) g = ( pi * Ntot / wcv ) if g > 1 : g = 0.999999999 for k in range ( 16 ) : if self . whovaccinated [ self . vacStep + 1 ] [ k ] == 1 : sigma [ k ] = 1 / mwl * ( - math . log ( 1 - g ) ) if sigma [ k ] < 0 : sigma [ k ] = 0 for f in range ( 16 ) : size = sum ( [ self . current_state [ self . _age_groups [ f ] ] [ '{}' . format ( s ) ] for s in popGrp ] ) if self . dCV1 [ f ] / size >= self . coverage_threshold [ f ] / 0.8944 : sigma [ f ] = 0 if self . t > 670 : return [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] return sigma
Computes sigma, the vaccination rate, regarding for each group if they are eligible to vaccination during a time period
Computes sigma the vaccination rate regarding for each group if they are eligible to vaccination during a time period
"""
        Computes sigma, the vaccination rate, regarding for each group if they are eligible to vaccination during a time period
        """
self