epidemioptim/environments/gym_envs/epidemic_vaccination_16.py
def update_with_action(self, action):
        """
        Implement effect of vaccination on vaccination rate.

        Parameters
        ----------
        action: int
            Action is a list with 0 (no vaccination) or 1 (vaccination).

        """
        # Translate actions
        self.previous_politic = self.vaccination_politic
        for i in range(16):
            if action[i] == 0:
                # no vaccination
                self.jump_of = min(self.time_resolution, self.simulation_horizon - self.t)
                self.vaccination_politic[i] = 0
                if self.previous_politic[i] == self.vaccination_politic[i]:
                    self.count_since_last_politic += self.jump_of
                else:
                    self.count_since_last_politic = self.jump_of
                    self.count_since_start_politic = 0
            else:
                self.jump_of = min(self.time_resolution, self.simulation_horizon - self.t)
                self.vaccination_politic[i] = 1
                if self.vaccination_politic[i] == self.previous_politic[i]:
                    self.count_since_start_politic += self.jump_of
                else:
                    self.count_since_start_politic = self.jump_of
                    self.count_since_last_politic = 0

        # Modify model parameters based on state
        sigma = self.compute_sigma_with_action(action)
        self.model.current_internal_params['sigma'] = np.array(sigma)
        if self.model.t > 670:
            for j in range(16):
               self.model.current_internal_params['sigma'][j] = 0

        Implement effect of vaccination on vaccination rate.

        Parameters
        ----------
        action: int
            Action is a list with 0 (no vaccination) or 1 (vaccination).

        
Implement effect of vaccination on vaccination rate.
Parameters

int
Action is a list with 0 (no vaccination) or 1 (vaccination).
Implement effect of vaccination on vaccination rate . Parameters int Action is a list with 0 ( no vaccination ) or 1 ( vaccination ) .
def update_with_action(self, action):
        self.previous_politic = self.vaccination_politic
        for i in range(16):
            if action[i] == 0:
                self.jump_of = min(self.time_resolution, self.simulation_horizon - self.t)
                self.vaccination_politic[i] = 0
                if self.previous_politic[i] == self.vaccination_politic[i]:
                    self.count_since_last_politic += self.jump_of
                else:
                    self.count_since_last_politic = self.jump_of
                    self.count_since_start_politic = 0
            else:
                self.jump_of = min(self.time_resolution, self.simulation_horizon - self.t)
                self.vaccination_politic[i] = 1
                if self.vaccination_politic[i] == self.previous_politic[i]:
                    self.count_since_start_politic += self.jump_of
                else:
                    self.count_since_start_politic = self.jump_of
                    self.count_since_last_politic = 0
        sigma = self.compute_sigma_with_action(action)
        self.model.current_internal_params['sigma'] = np.array(sigma)
        if self.model.t > 670:
            for j in range(16):
               self.model.current_internal_params['sigma'][j] = 0
def update_with_action ( self , action ) : self . previous_politic = self . vaccination_politic for i in range ( 16 ) : if action [ i ] == 0 : self . jump_of = min ( self . time_resolution , self . simulation_horizon - self . t ) self . vaccination_politic [ i ] = 0 if self . previous_politic [ i ] == self . vaccination_politic [ i ] : self . count_since_last_politic += self . jump_of else : self . count_since_last_politic = self . jump_of self . count_since_start_politic = 0 else : self . jump_of = min ( self . time_resolution , self . simulation_horizon - self . t ) self . vaccination_politic [ i ] = 1 if self . vaccination_politic [ i ] == self . previous_politic [ i ] : self . count_since_start_politic += self . jump_of else : self . count_since_start_politic = self . jump_of self . count_since_last_politic = 0 sigma = self . compute_sigma_with_action ( action ) self . model . current_internal_params [ 'sigma' ] = np . array ( sigma ) if self . model . t > 670 : for j in range ( 16 ) : self . model . current_internal_params [ 'sigma' ] [ j ] = 0
Implement effect of vaccination on vaccination rate.
Implement effect of vaccination on vaccination rate .
"""
        Implement effect of vaccination on vaccination rate.

        Parameters
        ----------
        action: int
            Action is a list with 0 (no vaccination) or 1 (vaccination).

        """ # Translate actions # no vaccination # Modify model parameters based on state
self
action