Professional Documents
Culture Documents
ncust = 1000;
% Notation:
% at = arrival time of a person joining the queue
% st = service time once they reach the front
% ft = finish time after waiting and being served.
%
% initialize arrays:
at = zeros(ncust,1);
ft = zeros(ncust,1);
for i=2:ncust
at(i) = at(i-1) + iat(i); % arrival times of other customers
end
ave_service_time = sum(st)/ncust
ave_wait_time = sum(wait_time)/ncust
ave_total_time = sum(total_time)/ncust