function t = LEM_launch_time(reservations,path,t1,t2,lane_lengths,speed,hd)
%

t = [];

len_path = length(path);
if len_path<1
    return
end

int1 = ones(1,t2-t1+1);
d = 0;

for k = 1:len_path
    flights = reservations(k).flights;
    [num_flights,dumm] = size(flights);
    for f = 1:num_flights
        ft1 = flights(f,2) - d/speed - hd;
        ft2 = flights(f,2) - d/speed + hd;
        if ft1<t2&ft2>t1
            ft1p = ft1 - t1 + 1;
            ft2p = ft2 - t1 + 1;
            ft1p = min(t2-t1+1,max(1,ft1p));
            ft2p = max(1,min(t2-t1+1,ft2p));
            int1(ft1p:ft2p) = 0;
        end
    end
    d = d + lane_lengths(k);
end

indexes = find(int1==1);
if ~isempty(indexes)
    t = indexes(1);
end
tch = 0;
