The representative of Health Department of Texas wants to investigate the optima
ID: 3920262 • Letter: T
Question
The representative of Health Department of Texas wants to investigate the optimal allocation of organ procurement organizations (OPOs) for organ transplant.
Please answer question 2, Suppose OPO 1 can cover demand points only within 50 miles. Explain in 10 sentences (or less) how to modify your program code?
Resource Allocation The representative of Health Department of Texas wants to investigate the optimal allocation of organ procurement organizations (OPOs) for organ transplant. Location data Demand x int # ???? 2 10 10.5 11 -5 2.5 6 21 24 28.5 3 -15 25 25.54 32.5-5 10 .9 12 13 OPO2 -6 OPO114 OPO1 30.5 -5.5 OPO2 20.5 5.5 OP03 | 25.5 | 3.5 Q1 (40 points). Write a program that can assign all demand points to the nearest or the farthest OPO given the location information above Program requirements 1. The distance must be calculated as follows: Distance between A and B(x of A - x of B)A2(y of A - y of B)2 We assume the unit of distance is mile 2. The program asks the user to choose one of the allocation rules specified below: (1) Rule 1: All demand points are assigned to the nearest OPO (2) Rule 2: All demand points are assigned to the farthest OPO 3. After the user chooses the rule, the program allocates the demand points following the rule the user chooses and prints out the allocation results. The program must check to be sure that the user input is valid. The program keeps displaying a warning message until the user puts a valid input. If the user repeatedly enters an invalid input more than 3 time, the program displays an error message and terminates. 4. 5. Sample Inputs/Outputs Invalid input! try again! Use selection(s), loop(s), and array(s) Chose an allocation rule: 1- nearest rule, or 2 farthest rule: 3 Chose an allocation rule: 1- nearest rule, or 2 Allocation Results: [1, 2, 3, 3, 2, 1, 1,2,...] farthest rule: 1 Q2 (20 points). Suppose OPO 1 can cover demand points only within 50 miles. Explain in 10 sentences (or less) how to modify your program codeExplanation / Answer
Here condition = nearest/farthest
1. First find out OPO2 or OPO3 that satisifies the condition. Assign allocation accordingly (2 or 3)
2. At the end check if OPO1saitisifies the condition. If it satisifies, check the distance is less than or equals to 50 (<=50).
3. If both the conditions are satisified then change the allocation to 1. Otherwise leave it as it is (2 or 3 assigned in step1).