Optimizing driving entity switching of semi-automated vehicles under automation degradation