def rollout(tree, s, depth):
    """Rollout from the current state s.

    Parameters
    ----------
    tree : :py:class:`ast_toolbox.mcts.MCTSdpw.DPWTree`
        The seach tree.
    s : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
        The current state.
    depth : int
        The maximum search depth

    Returns
    ----------
    q : float
        The estimated return.
    """
    if (depth == 0) | tree.f.model.isEndState(s):
        return 0.0
    else:
        a = tree.f.getAction(s, tree.s_tree)
        sp, r = tree.f.model.getNextState(s, a)
        qval = (r + rollout(tree, sp, depth - 1))
        return qval