(self, node)
Sets the internal env wrapper to the state ""node"" is in.

        Args:
            node:                   Any node (of any type) in a PublicTree instance.
Sets the internal env wrapper to the state ""node"" is in.
Sets the internal env wrapper to the state node is in .
def set_to_public_tree_node_state(self, node):
        """
        Sets the internal env wrapper to the state ""node"" is in.

        Args:
            node:                   Any node (of any type) in a PublicTree instance.
        """
        state_seq = []  # will be sorted. [0] is root.

        def add(_node):
            if _node is not None:
                if _node.p_id_acting_next != _node.tree.CHANCE_ID:
                    state_seq.insert(0, _node.env_state)
                add(_node.parent)

        add(node)  # will go from node to parent to parent of parent... to root and reverse the direction for the tree
        # fake step in the internal env to gain current rr state
        self.reset()
        self._reset_state()
        for sd in state_seq:
            self.env.load_state_dict(sd, blank_private_info=True)  # load cause _pushback uses the env's internal state
            self._pushback()
def set_to_public_tree_node_state ( self , node ) : state_seq = [ ] # will be sorted. [0] is root. def add ( _node ) : if _node is not None : if _node . p_id_acting_next != _node . tree . CHANCE_ID : state_seq . insert ( 0 , _node . env_state ) add ( _node . parent ) add ( node ) # will go from node to parent to parent of parent... to root and reverse the direction for the tree # fake step in the internal env to gain current rr state self . reset ( ) self . _reset_state ( ) for sd in state_seq : self . env . load_state_dict ( sd , blank_private_info = True ) # load cause _pushback uses the env's internal state self . _pushback ( )