통계적시뮬레이션(Simulation) - 기말고사 필기 정리본
- 최초 등록일
- 2015.08.13
- 최종 저작일
- 2014.11
- 12페이지/ 한컴오피스
- 가격 2,000원
목차
1. Single Server Queueing System
2. Queueing System with two Servers in Series
3. Queueing system with two parallel servers
4. Inventory model
5. Insurance-Risk Model
본문내용
1. Single Server Queueing System
- 손님의 도착 시간은 NPP()를 따른다 → 미리 알고리즘 만들어 놓을 것
- our interest
⓵ Average time a customer spends in the system
⓶ Average time past T that the last customer departs. → server가 언제 집에 갈수 있는지의 평균시간
<중 략>
# Intensity function
lambda.t = function(t)
{
tt = t %% 480
if (tt >= 0 && tt <= 120) rate = 0.5
if (tt > 120 && tt <= 240) rate = 1
if (tt > 240 && tt <= 360) rate = 2
if (tt > 360 && tt <= 480) rate = 1.5
return(rate)
}
# Subroutine for generating X ~ NPP(lambda(t))
NPPS = function(lambda, s)
# lambda: Maximum intensity function value in time interval [0,T]
# s: Current time
{
Z = s
U = 2 # The first loop should be performed.
ratio = 1
while (U > ratio)
{
Z = Z + rexp(1,lambda)
U = runif(1)
ratio = lambda.t(Z)/lambda
}
return(Z)
참고 자료
없음