% Simulation model of a single server queue
% Adapted from Law and Kelton (1991)
% T.Trani and H. Baik (March 99)

% Negative exponential function

% Purpose: generates a negative exponential random number

% Q_LIMIT				= queue limit to terminate the simulation
% mean_interarrival		= interarrival time in units of time
% mean_service			= service time in time units
% mean_delays_required 	= numbers of entities simulated

% Function calls: 	none

% Called from:		arrive.m (arrive function)
%					departure.m (departure function)
%					init.m (initialization function)


function e=expon(mean)

  u = rand(1);

  e = - mean * log(u);

