epidemioptim/environments/cost_functions/one_cost_death.py
def compute_deaths(self, previous_state, state, label_to_id, action, others={}):
        """
        Compute death toll

       Parameters
        ----------
        previous_state: 2D nd.array
            Previous model states (either 1D or 2D with first dimension # of states).
        state: 2D nd.array
            Current model states (either 1D or 2D with first dimension # of states).
        label_to_id: dict
            Mapping between state labels and indices in the state vector.
        action: int or nd.array
            Int for discrete envs and nd.array in continuous envs.

        Returns
        -------
        int
            Number of deaths
        """
        return self.costs[0].compute_cost(previous_state, state, label_to_id, action, others)

        Compute death toll

       Parameters
        ----------
        previous_state: 2D nd.array
            Previous model states (either 1D or 2D with first dimension # of states).
        state: 2D nd.array
            Current model states (either 1D or 2D with first dimension # of states).
        label_to_id: dict
            Mapping between state labels and indices in the state vector.
        action: int or nd.array
            Int for discrete envs and nd.array in continuous envs.

        Returns
        -------
        int
            Number of deaths
        
Compute death toll
Parameters

2D nd.array
Previous model states (either 1D or 2D with first dimension # of states).
state: 2D nd.array
Current model states (either 1D or 2D with first dimension # of states).
label_to_id: dict
Mapping between state labels and indices in the state vector.
action: int or nd.array
Int for discrete envs and nd.array in continuous envs.

Returns

int
Number of deaths
Compute death toll Parameters 2D nd . array Previous model states ( either 1D or 2D with first dimension # of states ) . state : 2D nd . array Current model states ( either 1D or 2D with first dimension # of states ) . label_to_id : dict Mapping between state labels and indices in the state vector . action : int or nd . array Int for discrete envs and nd . array in continuous envs . Returns int Number of deaths
def compute_deaths(self, previous_state, state, label_to_id, action, others={}):
        return self.costs[0].compute_cost(previous_state, state, label_to_id, action, others)
def compute_deaths ( self , previous_state , state , label_to_id , action , others = { } ) : return self . costs [ 0 ] . compute_cost ( previous_state , state , label_to_id , action , others )
Compute death toll
Parameters
Compute death toll Parameters
"""
        Compute death toll

       Parameters
        ----------
        previous_state: 2D nd.array
            Previous model states (either 1D or 2D with first dimension # of states).
        state: 2D nd.array
            Current model states (either 1D or 2D with first dimension # of states).
        label_to_id: dict
            Mapping between state labels and indices in the state vector.
        action: int or nd.array
            Int for discrete envs and nd.array in continuous envs.

        Returns
        -------
        int
            Number of deaths
        """
self
previous_state
state
label_to_id
action
others