County General Hospital is trying to chart its course through the troubled waters of the economy and shifting population demographics. To support the planning requirements of the hospital, you have been asked to develop a simulation program that will allow the hospital to evaluate alternative configurations of operating rooms, recovery rooms and operations guidelines. Your program will monitor the usage of operating rooms and recovery room beds during the course of one day. County General Hospital has several operating rooms and recovery room beds. Each surgery patient is assigned to an available operating room and following surgery the patient is assigned to one of the recovery room beds. The amount of time necessary to transport a patient from an operating room to a recovery room is fixed and independent of the patient. Similarly, both the amount of time to prepare an operating room for the next patient and the amount of time to prepare a recovery room bed for a new patient are fixed. All patients are officially scheduled for surgery at the same time, but the order in which they actually go into the operating rooms depends on the order of the patient roster. A patient entering surgery goes into the lowest numbered operating room available. For example, if rooms 2 and 4 become available simultaneously, the next patient on the roster not yet in surgery goes into room 2 and the next after that goes into room 4 at the same time. After surgery, a patient is taken to the available recovery room bed with the lowest number. If two patients emerge from surgery at the same time, the patient with the lower number will be the first assigned to a recovery room bed. (If in addition the two patients entered surgery at the same time, the one first on the roster is first assigned a bed.) Input The input file contains data for a single simulation run. All numeric data in the input file are integers, and successive integers on the same line are separated by blanks. The first line of the file is the set of hospital configuration parameters to be used for this run. The parameters are, in order: Number of operating rooms (maximum of 10) Number of recovery room beds (maximum of 30) Starting hour for 1st surgery of day (based on a 24-hour clock) Minutes to transport patient from operating room to recovery room Minutes to prepare operating room for next patient Minutes to prepare recovery room bed for next patient Number of surgery patients for the day (maximum of 100) This initial configuration data will be followed by pairs of lines of patient data as follows: Line 1: Last name of patient (maximum of 8 characters) Line 2: Minutes required for surgery Minutes required in the recovery room Patient records in the input file are ordered according to the patient roster, which determines the order in which patients are scheduled for surgery. The number of recovery room beds specified in any configuration will be sufficient to handle patients arriving from surgery (No queuing of patients for recovery room beds will be required). Computed times will not extend past 24:00.
2/3 Output Correct output shows which operating room and which recovery room bed is used by each patient, and the time period that the patient uses the room and bed along with a summary of the utilization of hospital facilities for that day. The output file consists of a set of two tables describing the results of the simulation run. The first table is in columnar form with appropriate column labels to show the number of each patient (in the order the patient roster), the patient’s last name, the operating room number, the time surgery beings and ends, the recovery bed number and the time the patient enters and leaves the recovery room bed. The second table will also be in columnar form with appropriate column labels summarizing the utilization of operating rooms and recovery room beds. This summary indicates the facility type (room or bed), the facility number, the number of minutes used and percentage of available time utilized. Available time is defined as the time in minutes from the starting time for 1-st surgery of day to the ending time of the last patient in a recovery room bed. Sample input 5 12 07 5 15 10 16 Jones 28 140 Smith 120 200 Thompson 23 75 Albright 19 82 Poucher 133 209 Comer 74 101 Perry 93 188 Page 111 223 Roggio 69 122 Brigham 42 79 Nute 22 71 Young 38 140 Bush 26 121 Cates 120 248 Johnson 86 181 White 92 140
3/3 Sample output Patient Operating Room Recovery Room
Room 1 Room 2 Room 3 Room 4 Room 5 Bed 1 Bed 2 Bed 3 Bed 4 Bed 5 Bed 6 Bed 7 Bed 8 Bed 9 Bed 10 Bed11 00.00 Bed12 00.00 165 29.68 248 44.60 258 46.40 162 29.14 263 47.30 282 50.72 263 47.30 280 50.36 282 50.72 209 37.59 223 40.11 211 37.95 327 58.81 122 21.94 121 21.76