def stay(node, taken): """Used when parent chooses an action that is NOT None""" child_t = node.t child_env = snapshot(node.env, node.t) child_env.removed_container[child_t].update(taken) child_acts = remove_taken(node.actions, taken) return Node(parent=node, t=child_t, env=child_env, taken=taken, actions=tuple(child_acts), reward=0)
def test_remove_taken(exp, tak, tru): assert set(remove_taken(exp, tak)) == tru