这是一篇来自加拿大的关于阅读并完全理解单队列单服务器系统的离散事件模拟模板源代码,然后将发布在光明空间—内容—第2、3周中的示例Jave代码转换为Python的Python代写,以下是作业具体内容:
To ensure that you read and fully understand the template source code for discrete-event simulation of single-queue-single-server systerm, translate the sample Jave code posted in Brightspace–Content–
Weeks 2,3 to Python. Note that you are not allowed to use existing python function to generate exponential or normal variates.
Using the given default parameters given in the sample code, generate 400 customers, and record their arrival times, departure times, service times, and waiting times in the queue in the following format:
Customer # Arrival Time Departure Time Service Time for the Customer The Customer’s Waiting Time in the Queue
In [2]:
Write your Python source code is below
Out[2]:
‘ Write your Python source code is below\n\n’
End of Problem 1
Problem 2 (50% for CSC 446, 25% for CSC 546)
- Apply the Chi-square test to the recorded 400 customers in Problem 1 to test the hypothesis that the customer arrival process follows a Poisson process, using the level of significance α = 0.05.
Ans: Write your answer here.
- Apply the Chi-square test to the recorded 400 customers in Problem 1 to test the hypothesis that the customer depature process follows a Poisson process, using the level of significance α = 0.05.
Ans: Write your answer here.
- What is your conclusion after the statistical test?
Ans: Write your answer here.
Hint: You can use inter-arrival times test for Poisson process: You can examine the inter-arrival times between successive events and check if they follow an exponential distribution. If the interarrival times follow an exponential distribution, then the arrival process can be considered a Poisson process.
End of Problem 2
Problem 3 (CSC 546 only, 25% for CSC 546)
Change the service times to exponentially distributed with mean value of 3.2. Run your simulation to generate 400 customers, and and record their arrival times, departure times, service times, and waiting times using the same format as in Problem 1.
- Apply the Chi-square test to the recorded customers to test the hypothesis that the customer arrival process follows a Poisson process, using the level of significance α = 0.05.
Ans: Write your answer here.
- Apply the Chi-square test to the recorded customers to test the hypothesis that the customer depature process follows a Poisson process, using the level of significance α = 0.05.
Ans: Write your answer here.
- What is your conclusion after the statistical test?
Ans: Write your answer here.
Hint: You can use inter-arrival times test for Poisson process: You can examine the inter-arrival times between successive events and check if they follow an exponential distribution. If the inter-arrival times follow an exponential distribution, then the arrival process can be considered a Poisson process.
End of Problem 3
In [ ]: