Stochastic dynamic programming with factored representations