function UR_URBAN_sim_SLC(t_max)
% UR_URBAN_sim_SLC - simulate flights with SLC street data
% On input:
%     t_max (float): max time to run simulation
% On output:
%     N/A
% Call:
%     UR_URBAN_sim_SLC(100);
% Author:
%     T. Henderson
%     UU
%     Summer 2019
%

% Set path to UAS functions
path(path,'C:\Users\user\Documents\MATLAB\URBAN-SIM\UAS');

% flight manager file name
f_FM = 'UR_flight_manager';

% USS file names
USS(1).name = 'UR_USS_111';
USS(2).name = 'UR_USS_23';

% MirrorWorld file name
f_MW = 'UR_MW';

% Set up roads (two end points, one edge)
%roads = UR_gen_roads_fixed1;
%roads = UR_gen_roads_fixed3x3;
load verts_and_edges_SLC.mat
edges = UR_clean_SLC_edges(edges);

v1 = vertices(:,1) - min(vertices(:,1));
v2 = vertices(:,2) - min(vertices(:,2));
pts = [v1,v2,zeros(length(v1),1)];
roads.vertexes = pts;
roads.edges = edges;
clear edges
clear vertices v1 v2

% Specify launch sites
fid = fopen('LAUNCH_SITES','w');
for e = 1:35
    fprintf(fid,'%d\n',e);
end
fclose(fid);

% Specify launch sites
fid = fopen('LAND_SITES','w');
for e = 1:35
    fprintf(fid,'%d\n',e);
end
fclose(fid);

t= 0;
while t<t_max&~UR_exit_flag
    t = t + 1
    UR_run_USS(USS,t);
    [airways,flight_plans,flights] = UR_flight_manager(roads,...
        'sim_data_SLC.txt');
    tch = 0;
end
% M = UR_MW_vis(airways,flight_plans,1,8,20,50);
tch = 0;
