Learning heuristic functions and search policies for classical planning