Combining stochastic programming and optimal control to solve multistage stochastic optimization problems