function [k,ko,t] = erlbaltes(A,h,N,L,I,K0)
% Call
%Where A = offered traffic in Erlang (for M/x queue lambda = A/h)
%      h = holding time is seconds   (For M/x queye mu =1/h)
%      N = Number of resources
%      L = Number of overflow trunks avaiable
%      I = number of attempts/arrivals to process
%      K0 = warm up/cool down period
% Returns
%      k = sequence of states visited: primary route
%      kt = sequence of states visited: secondary route
%      t  = times of state transitions

if (nargin == 5)
  K0 = 0; 
endif

[k,t] = erlbes(A,h,N+L,I,K0)

i = find(k>N);
ko = zeros(2*I,1);
ko(i) =k(i)-N;
k(i) = N;

subplot(211)
axis([0,max(t),0,N])
ylabel("Overflow calls")
plot(t,ko)

subplot(212)
axis([0,max(t),0,N])
ylabel("Primary Route Calls")
xlabel("Time - Seconds")
plot(t,k)