10SimHw7Sol - IEOR 4404 Assignment #7 Solutions Simulation...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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) 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:...
View Full Document

This note was uploaded on 11/17/2010 for the course IEOR IEOR 4404 taught by Professor C during the Spring '10 term at Columbia.

Page1 / 7

10SimHw7Sol - IEOR 4404 Assignment #7 Solutions Simulation...

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

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