Adding all_predecessors and all_successors method to transition function