def _predict(self, my_task, seen=None, looked_ahead=<NUM_LIT:0>):
if my_task._is_finished():<EOL><INDENT>return<EOL><DEDENT>if seen is None:<EOL><INDENT>seen = []<EOL><DEDENT>elif self in seen:<EOL><INDENT>return<EOL><DEDENT>if not my_task._is_finished():<EOL><INDENT>self._predict_hook(my_task)<EOL><DEDENT>if not my_task._is_definite():<EOL><INDENT>if looked_ahead + <NUM_LIT:1> >= self.lookahead:<EOL><INDENT>return<EOL><DEDENT>seen.append(self)<EOL><DEDENT>for child in my_task.children:<EOL><INDENT>child.task_spec._predict(child, seen[:], looked_ahead + <NUM_LIT:1>)<EOL><DEDENT>
Updates the branch such that all possible future routes are added.

Should NOT be overwritten! Instead, overwrite _predict_hook().

:type  my_task: Task
:param my_task: The associated task in the task tree.
:type  seen: list[taskspec]
:param seen: A list of already visited tasks.
:type  looked_ahead: integer
:param looked_ahead: The depth of the predicted path so far.