function arrival_times = TRI_Poisson(lambda,T)
%

arrival_times = [];

t = 0;
I = 0;
done = 0;
while done==0
    U = rand;
    t = t - log(U)/lambda;
    if t>T
        done = 1;
    else
        I = I + 1;
        arrival_times(I) = t;
    end
end

return