def get_reward(intervention, state):
    """Compute the reward based on the observed state and choosen intervention."""
    Q, R1, R2, S = 0.1, 20000.0, 20000.0, 1000.0
    reward = S * state.immune_response - Q * state.free_virus
    reward -= R1 * intervention.updates['epsilon_1'] ** 2
    reward -= R2 * intervention.updates['epsilon_2'] ** 2
    return reward
