epidemioptim/environments/models/heffernan_ode_model_16.py
def _sample_initial_state(self):
        """
        Samples an initial model state from its distribution (Dirac distributions if self.stochastic is False).

        """
        self.initial_state = dict()
        for i in self._age_groups:
            self.initial_state[i] = dict()
            for k in self._all_initial_state_distribs[i].keys():
                self.initial_state[i][k] = self._all_initial_state_distribs[i][k].sample()
                if i in ['20-24', '25-29', '30-34', '35-39', '40-44', '45-49']:
                    self.initial_state[i]['I20'] = 10/6
                    self.initial_state[i]['I30'] = 1/6
            # S10 is computed from other states, as the sum of all states equals the population size N
            self.initial_state[i]['S10'] = self.pop_size[i] - np.sum([self.initial_state[i]['{}0'.format(s)] for s in self.internal_states_labels[1:]])

        Samples an initial model state from its distribution (Dirac distributions if self.stochastic is False).

        
Samples an initial model state from its distribution (Dirac distributions if self.stochastic is False).
Samples an initial model state from its distribution ( Dirac distributions if self . stochastic is False ) .
def _sample_initial_state(self):
        self.initial_state = dict()
        for i in self._age_groups:
            self.initial_state[i] = dict()
            for k in self._all_initial_state_distribs[i].keys():
                self.initial_state[i][k] = self._all_initial_state_distribs[i][k].sample()
                if i in ['20-24', '25-29', '30-34', '35-39', '40-44', '45-49']:
                    self.initial_state[i]['I20'] = 10/6
                    self.initial_state[i]['I30'] = 1/6
            self.initial_state[i]['S10'] = self.pop_size[i] - np.sum([self.initial_state[i]['{}0'.format(s)] for s in self.internal_states_labels[1:]])
def _sample_initial_state ( self ) : self . initial_state = dict ( ) for i in self . _age_groups : self . initial_state [ i ] = dict ( ) for k in self . _all_initial_state_distribs [ i ] . keys ( ) : self . initial_state [ i ] [ k ] = self . _all_initial_state_distribs [ i ] [ k ] . sample ( ) if i in [ '20-24' , '25-29' , '30-34' , '35-39' , '40-44' , '45-49' ] : self . initial_state [ i ] [ 'I20' ] = 10 / 6 self . initial_state [ i ] [ 'I30' ] = 1 / 6 self . initial_state [ i ] [ 'S10' ] = self . pop_size [ i ] - np . sum ( [ self . initial_state [ i ] [ '{}0' . format ( s ) ] for s in self . internal_states_labels [ 1 : ] ] )
Samples an initial model state from its distribution (Dirac distributions if self.stochastic is False).
Samples an initial model state from its distribution ( Dirac distributions if self . stochastic is False ) .
"""
        Samples an initial model state from its distribution (Dirac distributions if self.stochastic is False).

        """ # S10 is computed from other states, as the sum of all states equals the population size N
self