A Simulation-based Approach to Stochastic Dynamic Programming