function res = LEM_scenario1
% LEM_scenario1 - demo for LSD on scale of 1/4 of SLC
% On input:
%     N/A
% On output:
%     res (res struct): result info
%       .roads (roads struct): one used in scenario
%       .airways (airways struct): one used in scenario
%       .requests (requests struct): one used in scenario
%       .times (nx1 vector): flight launch times in scenario
%       .reservations (reservations struct): one used in scenario
%       .flights (flights struct): one used in scenario
% Call:
%     res = LEM_scenario1;
% Author:
%     T. Henderson
%     UU
%     Fall 2020
%

rng('default');   % reset random seed

x_min = -18500;    % define grid in terms of feet from the origin
x_max = 18500;
y_min = -11500;
y_max = 11500;
del_x = 2000;      % intersections every 2000 feet
p1 = 0.50;         % percentage road vertexes assigned as launch sites
p2 = 0.50;         % percentage road vertexes assigned as land sites
min_lane_len = 20; % minimum length for a lane

roads = LEM_grid_roads(x_min,x_max,y_min,y_max,del_x,del_x);
num_gv = length(roads.vertexes(:,1));
l1 = randperm(num_gv);
l1 = l1(1:ceil(p1*num_gv));
l2 = randperm(num_gv);
l2 = l2(1:ceil(p2*num_gv));
airways = LEM_gen_airways(roads,l1,l2,min_lane_len);

t_min = 0;           % start sim time
t_max = 4000;       % end sim time
del_t = 0.5;         % time step (for physics simulation)
num_flights = 4000;  % number of flights
launch_interval = 4000; % spread in possible launch times
speeds = [30,30];    % [min,max] speeds (here both the same)
hd = 50;             % headway distance

[requests,times] = LEM_gen_requests(t_min,0.9*t_max,airways,num_flights,...
    launch_interval,speeds);

sigma = 0.001;     % variance in UAS position during flight update

res = LEM_scenario_LSD(roads,airways,requests,times,t_min,t_max,del_t,...
    sigma,hd);

tch = 0;
