@staticmethod
def _cartpole_balance_death(env, time_step) ->bool:
    """If the reward is less than 0.7 consider a state dead. This threshold is because rewards
        lesser than 0.7 involve positions where the cartpole is not balanced.
        """
    return time_step.reward < 0.75 or abs(env.physics.cart_position()) > 0.5
