Homework Six - Simio and Simulation: Chapter 5

Complete problems 1, 2, 3, 4, and 5 from Chapter 5 in Kelton.

#create reproducability
set.seed(123)

Problem 1

What is the difference between an object property and an object state?

Object Property - ‘defined within an object to collect information from the user to customize that object’s behavior.’

Object State - ‘defined within an object to hold the value of something that might change while the model is running.’

Object properties are the settings that define how an object behaves (i.e. if the object is an entity or server, and if the server intakes 1 or 3 resources at a time). Object states are like attributes and the state at a given time is a set of information. States can continuously change during the simulation, while properties are set by the user and do not change.

Problem 2

Consider a process associated with a Server object. What is the difference beeween a token’s parent object and it’s associated object?

The token’s parent object is the object in which the process is defined, while an associated object is the object that triggered the process.

Problem 3

Develop a queueing model that gives the steady-state values analogous to the values in Table 5.2 (Model 5-1 with the exponential processing times at both stations).

Simio Simulation Model

Simio Simulation Model

Simio Simulation Experiment

Simio Simulation Experiment

prob3csv <- read.csv('https://raw.githubusercontent.com/chrisgmartin/DATA604/master/HW6%20Model_Model_Experiment1_ResultsSummary.csv')
prob3results <- prob3csv[c(44, 10, 1, 4, 88, 82), c(3, 6, 7, 8, 9, 10, 11, 12)]
prob3results
##    Object.Name            Data.Item  Statistic.Type      Average
## 44   Placement ScheduledUtilization         Percent   66.7629758
## 10  Inspection ScheduledUtilization         Percent   50.0536409
## 1          PCB       NumberInSystem         Average    1.8487035
## 4          PCB         TimeInSystem Average (Hours)    0.1846312
## 88   GoodParts        NumberEntered           Total 5368.2400000
## 82    BadParts        NumberEntered           Total 4643.4800000
##         Minimum      Maximum   Half.Width Standard.Deviation
## 44   65.3291165   68.1639345  0.240276522        0.582065218
## 10   49.0733873   50.9760959  0.179714123        0.435353979
## 1     1.7326060    1.9160939  0.017468956        0.042318207
## 4     0.1765593    0.1903431  0.001249169        0.003026088
## 88 5256.0000000 5511.0000000 25.557032199       61.911415210
## 82 4552.0000000 4772.0000000 23.467392575       56.849303719

Problem 4

Consider an office where people come to get their drivers’ licenses. The process involves three steps for arriving customers – reception / application; a vision exam; and a written exam. Assume that customer arrivals are Poisson with a rate of 6 per hour (i.e., interarrival times are exponentially distributed with mean 10 minutes). The processing time distributions for the three processes are given in Table 5.8. The office has one person responsible for reception/application and one person responsible for administering the vision exams. The written exam is computer-based and there are three computer stations where customers can take the exam. Develop a Simio model of this system. Assume that the office opens at 9:00 a.m. and closes at 5:00 p.m. The performance metrics of interest include the time that customers spend in the system, the utilizations of the office employees and computer stations, and the average and maximum numbers of customers in the reception/application queue, the vision exam queue, and the written exam queue. How many replications should be run in order to be confident about your results? Justify your answer.

#Table 5.8 Processing Time Parameters for Problem 4
data.frame('Process'=c('Reception/Application','Vision Exam', 'Written Exam'), 'Processing time distribution'=c('triangular(5, 8, 11)', 'triangular(2, 4, 6)', 'triangular(15, 15, 20)'))
##                 Process Processing.time.distribution
## 1 Reception/Application         triangular(5, 8, 11)
## 2           Vision Exam          triangular(2, 4, 6)
## 3          Written Exam       triangular(15, 15, 20)

The model is run for 8 hours (9:00 am to 5:00 pm), with performance metrics below (in Problem 5) for 50 replications of the model with no warm up time. Since this simulation has three main servers each with triangular distributions across short time-frame (8 hours), the number of replications should be high enough for confidence but not too high for unnecessary overhead on resources. My decision for 50 replications is that, on a made-up scale, 100 replications is a very high precision and 1 is a single run through. The simulation is not overly difficult (there are no weighted links or conditional properties),

Problem 5

Animate the model from Problem 4. If you did not already do so, specify a reasonable office layout and use Path object to incorporate customer movement through the office. Make sure that the distances between stations are reasonable for a drivers’ license office and that the entity speed is appropriate for humans walking.

Simio Simulation Model

Simio Simulation Model

Simio Simulation Model Animation

Simio Simulation Model Animation

Distances seem reasonable and walking paths were set to .15 minutes per path (9 seconds).

prob5csv <- read.csv('https://raw.githubusercontent.com/chrisgmartin/DATA604/master/HW6%20Model_Model2_Experiment1_ResultsSummary.csv')
prob5results <- prob5csv[c(4, 10, 44, 52, 26, 27, 64, 65, 88, 89), c(3, 6, 7, 8, 9, 10, 11, 12)]
prob5results
##             Object.Name            Data.Item  Statistic.Type      Average
## 4         DefaultEntity         TimeInSystem Average (Hours) 6.765214e-01
## 10 ReceptionApplication ScheduledUtilization         Percent 7.823142e+01
## 44           VisionExam ScheduledUtilization         Percent 3.875532e+01
## 52           VisionExam       TimeProcessing Average (Hours) 6.668532e-02
## 26 ReceptionApplication      NumberInStation         Average 1.225905e+00
## 27 ReceptionApplication      NumberInStation         Maximum 5.280000e+00
## 64           VisionExam      NumberInStation         Average 3.875532e-01
## 65           VisionExam      NumberInStation         Maximum 1.000000e+00
## 88          WrittenExam      NumberInStation         Average 3.977415e-05
## 89          WrittenExam      NumberInStation         Maximum 1.000000e+00
##        Minimum      Maximum   Half.Width Standard.Deviation
## 4   0.54704635  1.062167481 3.438510e-02       0.1203660172
## 10 58.86182963 97.986861008 2.655044e+00       9.2940567722
## 44 27.77726440 49.522733281 1.343275e+00       4.7021734768
## 52  0.06267342  0.072900478 6.301293e-04       0.0022057857
## 26  0.29467442  4.313599817 2.572232e-01       0.9004173205
## 27  2.00000000 10.000000000 6.296943e-01       2.2042630311
## 64  0.27777264  0.495227333 1.343275e-02       0.0470217348
## 65  1.00000000  1.000000000 0.000000e+00       0.0000000000
## 88  0.00000000  0.001734277 7.053053e-05       0.0002468941
## 89  1.00000000  1.000000000 0.000000e+00       0.0000000000

The performance metrics of interest include the time that customers spend in the system, the utilizations of the office employees and computer stations, and the average and maximum numbers of customers in the reception/application queue, the vision exam queue, and the written exam queue.

Banks DES, Chapter 8: 5

Banks 5

Given the folling cdf for a continuous variable with range from -3 to 4, develop a generator for the variable, generate 1000 values, and plot a histogram:

\(F(x) = 0, x <= -3\)

\(F(x) = \frac{1}{2} + \frac{x}{6}, -3 < x <= 0\)

\(F(x) = \frac{1}{2} + \frac{x^2}{32}, 0 < x <= 4\)

\(F(x) = 1, x > 4\)

banks5 <- function(size){
  x <- runif(size, min=-3, max=4)
  for(i in 1:size){
    if(x[i] == 0){
      x[i] <- -3
    } else if(x[i] > -3 & (x[i] < 0 | x[i] == 0)){
      x[i] <- (1/2) + (x[i]/6)
    } else if(x[i] > 0 & (x[i] <4 | x[i] == 4)){
      x[i] <- (1/2) + (x[i]^2)/32
    } else{
      x[i] <- 1
    }
  }
  x
}

gen5 <- banks5(1000)
summary(gen5)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## 0.0005429 0.2959000 0.5058000 0.4860000 0.6551000 0.9990000
hist(gen5)

plot(density(gen5), xlim=c(0,1))