A stochastic optimization approach for robot scheduling