Stochastic linear programming to optimize some stochastic systems