Integration of simulation and planning