The behavior of simulated annealing in stochastic optimization