def get_reward(intervention, state, config, time):
    """Compute the reward based on the observed state and choosen intervention."""
    C = 1000
    C1 = 1
    C2 = 5
    deaths = state.nonmedical_users * config.nonmedical_overdose
    deaths += state.oud_users * config.oud_overdose[time]
    deaths += state.illicit_users * config.illicit_overdose[time]
    reward = -C * deaths
    reward -= C1 * intervention.updates['nonmedical_incidence'
        ] * state.nonmedical_users
    reward -= C2 * intervention.updates['illicit_incidence'
        ] * state.illicit_users
    return reward
