def get_q_values(node):
    """
    Return all triples (state, action, q)
    
    Parameters
    ----------
    node : Node
        Initial node.

    Returns
    -------
    Recursively transverse the tree, and return all triples (state, action, q)

    """
    if node.children == None:
        return [[node.state_val, node.action_val, node.qVal]]
    else:
        q_values = []
        for c in node.children:
            q_values.extend(get_q_values(c))
        return q_values