Optimal stopping and controls