function [root, final_node, scene, traj_t, traj_x] = runStopSignMCTS(scenario_file, ad, vd, stop_duration)

%runStopSignMCTS(x0, dgrid, grid_end, acc_max, dt_max, position_adjacency_factor, state_knots)
    
    plot_most_visited = true;
    do_animate = false;
    traj_t = [];
    traj_x = [];
    
    if ~exist(scenario_file, 'file')
        error('File Does Not Exist');
    end

    
    scene = ScenarioDescription(scenario_file);

    proposition_handler{1} = stopSignHandler(scene, stop_duration);
    LTL_automata{1} = LTLAutomata('stop_sign.aut');
    start_LTL_state{1} = LTL_automata{1}.start_state_index;
    internal_proposition_state{1} = 0;
    
    stop_region_pts = scene.getStopSignPoints(2); % 2 to signify coming from the left.
    Xstops = [stop_region_pts(:,1)', scene.goal_pt(1)];
    x0 = scene.getx0;
    
    
    dX = .5;
    dv = 1;
%     dX = .31;
%     dv = .71;
         
    max_X = scene.goal_pt(1);
    max_v = vd + 2;
    dt_max = 10;
    pos_adj_factor = 5;
    max_a = ad;
    stop_ranges = [Xstops'-1.5, Xstops'+1.5];
%     lat = BuildLattice(x0, [dX, dv], [max_X, max_v], max_a, dt_max , pos_adj_factor, [Xstops', zeros(length(Xstops),1)]);
    lat = BuildLattice(x0, [dX, dv], [max_X, max_v], max_a, dt_max , pos_adj_factor, [], stop_ranges);

    root = MCTSNode(MCTSNode.empty(0), [0, 0], [x0; x0], 0, lat.state_knots_index(1,:), lat, scene, LTL_automata, proposition_handler, start_LTL_state, internal_proposition_state);

    do_stop = false;
    cnt = 1;
    while ~do_stop && cnt < 1000
        [~, final_node] = root.selection();
        if ~isempty(final_node)
            do_stop = true;
        end
        fprintf('cnt %d \n', cnt);
        cnt = cnt+1;
    end

    figure
    hold on
    ax = gca;
    scene.drawFrame(ax, [0,0], scene.start_pos, scene.start_angle);
    offset = 5;
    lat.plotVertices(ax, offset);
    root.plotTree(ax,offset);
    if ~isempty(final_node)
        final_node.plotBranch(ax, offset);
        pause(1)
        if do_animate
            figure
            ax = gca;
            [traj_t, traj_x] = final_node.save_branch();
            animatePath(scenario_file, traj_t, traj_x);
        end
    end
    if plot_most_visited
        root.plotMostVisited(ax,offset);
    end
