Teaching computers to plan for the future