A2Q2 (with input rates and ignore left in system)

A2Q2 (with input rates and ignore left in system) -...

This preview shows page 1 - 2 out of 2 pages.

print("STAT 340 ASSIGNMENT 2 QUESTION 2 SUBMISSION") print("Student Name: Jonathan Jong ; User ID: jyejong ; Student ID: 20360459") print("Group with Chooi Yee Phang ; User ID: cyphang ; Student ID: 20360187") print("Used a modified GM1 code originally provided by Professor Riley Metzger") # assess is a function which takes in: # i. arrival rate, # ii. departure rate, and # iii. T, the time the queue stops accepting arrivals. # It outputs a matrix with first column containing the arrival time of # the patients, second column the departure time from the initial # assessment, and third column the priority the patient was given. # The row number represents the i-th patient # (only those who managed to depart before time T). assess = function(arrival_rate,departure_rate,T) { A = arrivals(arrival_rate,T) D = GM1(A,T,departure_rate) n = length(D) A = A[1:n] priority = sample(0:4,n,replace = TRUE) output = matrix(nrow = n, ncol = 3) output[,1] = A output[,2] = D output[,3] = priority print(output) } # arrivals is a function which takes in T (as defined above), and outputs a
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Spring '09
  • ChristianeLemieux
  • Cassie, Professor Riley Metzger

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern