hwk10sol - IEOR 4404 Simulation Prof. Mariana...

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

View Full Document Right Arrow Icon
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;
Background image of page 1

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

View Full DocumentRight Arrow Icon
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; 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; 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 %transit between the first 16 hours and the last 8 hours
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

hwk10sol - IEOR 4404 Simulation Prof. Mariana...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online