联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2021-03-05 11:11

Project 1

Discrete Event Simulation of a Mass Vaccination Site

In this project, your group will implement some of the basic elements of an eventdriven

simulation of a system with two dependent queues. You will implement

queues, servers, event routines, and periodically print statistics. You will also

design and implement data structures and the routines to maintain them, and a

main routine to coordinate all parts of the simulation.The details of the system are

described below.

Background:

You are asked by the provincial government to design a mass vaccination site for

COVID-19 vaccinations. Vaccinations are organized at a large event venue that

has a maximum occupancy of B visitors (to accommodate physical distancing

guidelines). Vaccinations are administered from 9 AM to 5 PM daily. Vaccine

doses are given to visitors on a first-come, first-serve basis. Each visitor entering

the site needs to wait in line to get checked in (for ID verification). Check-in is

done by m1 check-in volunteers. After check-in, visitors wait in another line to

receive their vaccine dose by m2 nurses. After a vaccine dose is administered, each

visitor needs to wait for t minutes (to make sure they don’t have any obvious side

effects) before departing the vaccination site.

System to Simulate:

The system consists of two queues, one after the other. Once visitors enter the site,

they stay in either the check-in queue, the vaccination queue, or the waiting

area. The first “check-in” queue has m1 servers. The second “vaccination” queue

has m2 servers. The total number of visitors in the whole system should not

exceed system capacity B. This maximum capacity includes visitors in both queues,

visitors being served and visitors in the waiting area. Visitors arrive and enter the

check-in queue if the system is not full. The visitor at the head of each queue

receives service when any of the servers becomes available. Each visitor has to pass

both queues and the waiting area before departing the system. Simulation will

start at the beginning of the day (9 AM) end when the last visitor that entered

before or at 5 PM leaves the site.

Queues:

You will implement two M/M/m queues. You can assume that visitors come from

an infinite population, and that vaccine supply is sufficient to vaccinate all visitors

who enter the site. Assume that the queueing discipline for each queue is FCFS

(First-come, First-served). Arriving visitors leave immediately if the site is at full

capacity and do not return the same day.

Random Variate Generation:

Visitor interarrival time and both queues’ service time distributions are

exponential. Arrivals are generated based on the mean interarrival time 1/

λ minutes. Service time of the check-in queue is based on a service time

distribution with mean service time 1/μ1 minutes. Service time of the vaccination

queue is based on a service time distribution with mean service time 1/μ2 minutes.

Time in the waiting area is deterministic at t minutes. You will need to write a

separate function for each distribution to generate values for arrival times and

service times per server based on the exponential distribution. You should use C’s

uniformly-distributed random number generator as the basis for your random

variate generation (similar to HW3).

Event Routines:

You need to write a separate function for each of the event routines: Arrival, start

service of check-in queue, depart from check-in queue and arrive at vaccination

queue, start service at vaccination queue, depart from vaccination queue and enter

waiting area, depart waiting area and system.

End of Simulation:

Simulation starts at 9 AM. Simulation ends when the last visitor who arrived

before or at 5 PM leaves the system. No visitors are allowed to enter the system

after 5 PM.

Performance Metrics:

You need to keep track of the following performance metrics for the duration of

the simulation:

? Current number of visitors in system

? Response time for each departing visitor (time between when a visitor

enters and leaves the whole system)

? Waiting time in check-in queue for each visitor that starts service with

a check-in volunteer

? Waiting time in vaccination queue for each visitor that starts service

with a vaccination nurse

? Number of visitors who leave the system because it’s at full capacity

when they arrive

Report Generation:

Using the above statistics (and others you might want to track), you need to

generate a report with these performance metrics:

? Total number of departures, or the total number of vaccinated visitors

leaving the site

? Average number in system

? Average response time

? Average waiting time in check-in queue

? Average waiting time in vaccination queue

? Number of visitors who leave the system because it's at full capacity

when they arrive.

This report should be generated periodically after each hour of simulated time

(i.e., at 10 AM, 11 AM, 12 PM, ..., 5 PM), as well as at the end of simulation. You

need to compute these statistics during runtime.

Your simulation should correctly handle any correct choice of input

parameters λ, μ1, μ2, t, B, m1 and m2. All these parameters should be

arguments to call the program, in addition to the random seed S.

Submission instructions:

Submit a single file “proj1.c” containing the source code of your simulation

program (including all the data structure definitions and appropriate comments).

The first line in the file should be a comment that includes the command line you

use to compile the program. Your executable should run using the following

command line parameter format:

./proj1 λ μ1 μ2 t B m1 m2 S

The arrival and service rates as well as wait time t can be real numbers, but the

remaining parameters are all integers.

For example: ./proj1 10 0.5 0.25 15 500 30 50 821

Should simulate a system with arrival rate of 10 visitors per minute, service rate

per check-in server of 0.5 visitors per minute, service rate per vaccination server

of 0.25 visitors per minute, a wait time of 15 minutes, site capacity of 500, 30

check-in servers, 50 vaccination servers, and a random seed of 821.

Important Note: Your code should be readable. It should use easy to understand

variable and function names. It should include a lot of comments to enable others

to understand it. Please err on the side of more comments and more explanation.

The quality of your code and ease of understanding it will be part of your grade.

Choosing efficient data structures that speed up simulation time is a plus.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp