10SimHw7Sol

# 10SimHw7Sol - IEOR 4404 Simulation Prof Mariana...

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

IEOR 4404 Assignment #7 Solutions Simulation March 28, 2010 Prof. Mariana Olvera-Cravioto Page 1 of 7 Assignment #7 Solutions 1. Solution: (a) events: Arrivals to the facility Departures from channels variables: time variable: t counter variable: N L = number of lost messages facility stae: n = number of busy channels event list: t A = time of next arrival (after t) t 1 , t 2 , t 3 = processing completion times (in order), t 1 t 2 t 3 . (b) (c)

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

View Full Document
2 IEOR 4404, Assignment #7 Solutions Poisson: function f=Poisson(t, lambda) U1 = rand; f= t - log(U1)/lambda; *********** Service: function g=service(t) U=rand; if (mod(t,3)<2) g=U; else g=U^(1/3); end *********** Reorder: function [x,y,z]=reorder(t1,t2,t3) a1=t1; a2=t2; a3=t3; if a1>a2 a1=t2; a2=t1; end if a1>a3 x = a3; y = a1; z = a2; elseif (a1<=a3) && (a2>a3) x = a1; y = a3; z = a2; else x = a1; y = a2; z = a3; end *********** Facility: function lost = facility(T, lambda)
IEOR 4404, Assignment #7 Solutions 3 t=0; NL=0; n=0; tA = Poisson(0,2); tt=[Inf, Inf, Inf]; Stop = 0; while Stop == 0; if (tA <= tt(1)) && ( tA<=T) t=tA; tA=Poisson(t, lambda); if n==3 NL=NL+1; else n=n+1; tt(n)=t + service(t); [tt(1),tt(2),tt(3)]=reorder(tt(1),tt(2),tt(3)); end elseif (tt(1)<tA) && (tt(1)<=T) t=tt(1); n=n-1; tt(1)=Inf; [tt(1),tt(2),tt(3)]=reorder(tt(1),tt(2),tt(3)); elseif (min(tA,tt(1)) > T) Stop = 1; end end lost = NL; *********** Sim: function meanlost=sim(T,lambda) N=10^5; sum=0; for i=1:N sum = sum+facility(T,lambda); end

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

View Full Document
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