ai :: SearchNode :: apply_action
problem
.Used internally by the solvers but made public for those who want to replay a plan.
ensure result.parent == self
ensure result.action == action
# Create a new child node for the next state, according to `problem`.
# Used internally by the solvers but made public for those who want to replay a plan.
#
# ensure `result.parent == self`
# ensure `result.action == action`
fun apply_action(action: A): SearchNode[S, A]
do
var new_state = problem.apply_action(state, action)
var new_cost = problem.cost(state, action, new_state)
var new_node = new SearchNode[S, A](problem, new_state, self, action, cost + new_cost, depth+1)
new_node.compute_heuristic
return new_node
end
lib/ai/search.nit:685,2--697,4