hwk10sol

# hwk10sol - IEOR 4404 Simulation Prof Mariana...

This preview shows pages 1–3. Sign up to view the full content.

IEOR 4404 Assignment #10 Solutions Simulation 8th December 2006 Prof. Mariana Olvera-Cravioto Page 1 of ?? Assignment #10 Solutions 1. (a) The traffic intensity ρ is given by: ρ = λ μ * where μ * = 2 / 3 × 16 + 1 / 3 × 8 and λ = 10. Since ρ < 1, the system is well-defined. (b) The process N 1 , N 2 , ... has a steady state since ρ < 1 . (c) Please see the code below. clear all; T=480; %time length (hours) la=10; %arrival rate ls=8; %service rate SS=10; X=zeros(SS,T); for j=1:SS N=zeros(1,T+1); t=0; n=0; td1=inf; %departure time of server 1 td2=inf; %departure time of server 2 U=rand; %generate the 1st arrival ta=(-1/la)*log(U); %interval=1 if we are in the first 16 hours of a day; %interval=2 if we are in the last 8 hours of a day interval=1; ti=16; e=0; while(t<=T) if ta<min(min(td1,td2),ti) %an arrival happens t=ta; n=n+1; U=rand; %generate a new arrival ta=t-(1/la)*log(U); if n<=2 U=rand; if td1==inf td1=t-(1/ls)*log(U); elseif interval==1 td2=t-(1/ls)*log(U); end end e=e+1;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 IEOR 4404, Assignment #10 Solutions P(e,:)=[t,n,interval,td1,td2,ti]; elseif td1<=min(min(td2,ta),ti) %a departure happens at server 1 t=td1; n=n-1; if n==0 || (n==1 && td2~=inf) td1=inf; else U=rand; td1=t-(1/ls)*log(U); %generate a new departure time of server 1 end N(floor(t)+1)=N(floor(t)+1)+1; e=e+1; P(e,:)=[t,n,interval,td1,td2,ti]; elseif td2<=min(min(td1,ta),ti) %a departure happens at server 2 t=td2; n=n-1; if interval==1 && n>=2 U=rand; td2=t-(1/ls)*log(U); %generate a new departure time of server 2 else td2=inf; end N(floor(t)+1)=N(floor(t)+1)+1; e=e+1; P(e,:)=[t,n,interval,td1,td2,ti]; else
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern