Question

In C++, no code necessary just need to describe Describe how you would solve such a...

In C++, no code necessary just need to describe

Describe how you would solve such a problem:

When a resident of a small town calls the 911 center , the address must be located from the phone number immediately. This town gets many calls but there are times when there are not enough police forces for each call received. So a queue is formed for getting help. But this queue is based on the importance of the calls. The 911 center must also keep track of the police officer that is assigned to a call. When the police officer is done with its task, it will notify the center. The center also keeps track of the time it took the officer to complete a task. The call center gather the amount of wait time (duration of time -- starting the call received until a police was assigned) and service time (duration of time -- starting at the time the police went to the place to the time the police informed the center for end of service) for each call.

The police department would like to know what time of day we get the shortest wait time and what time of day we have the shortest service time. In general they want to know the sorted values in terms of time. In addition, the police department may for example ask the 911 center who are the last three officers that were assigned to provide service on a given day.

What are the best structures to use by 911 center and what are the best algorithms to run in order to perform the above tasks properly and answer the questions that the police department may have in regards to calls?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Now this is a classical resource allocation algorithm with some variation

Here there are two entities police officers let's say we have (N) i.e limited

now since calls can be a lot and they need to be dealt first come first serve basis

1) Queue of call structure
call structure. will have two fields 1) name or id 2) arrival_time

2) Queue to see the assigned officer i.e officer call structure
officer call structure will have two fields 1) name/id officer 2) dispatch time 3) finish time

3) Array to store the average response time (arrival -dispatch)

4) Arrat to store the average service time (dispatch - finish)


// Algorithm

for every Call create a new call object (with and time(0) ) for start and push in activeCalls queue

check activeOfficer queue size ==0 pick an officer and create an object (id, time, 0) [0 as we don't know finish time]
also calculate time difference when assigning and push to responseTime array

if(activeOfficer.size == N (total officer size) ) do busy waiting

if job is over[i am asuming there is a way for it] calulate serve time = finish -dispatch push in service time array

do as along as jobs are there


last 3 officer is basically get last 3 elements of queue

average time is sum of respective arrays( response and service) by count



Hope it helps do let me know if there is any doubt

Add a comment
Know the answer?
Add Answer to:
In C++, no code necessary just need to describe Describe how you would solve such a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Describe how the officers' behaviors might be improved by using the basic principles of police organization...

    Describe how the officers' behaviors might be improved by using the basic principles of police organization as well as policies, procedures, rules, regulations, and discipline. bodily from the station by the patrol officer, who pushed him down a flight of steps to the sidewalk. The man regained his equilibrium and quietly walked off into the night, beaten by the system. He returned later, paid the fee, and reclaimed his car. DISCUSSION QUESTIONS 1. If you were the sergeant in this...

  • Can you piea se Show how 4a 2 got the answer F helps me. understand H better Thant you So much Problem 1 REGIONA...

    Can you piea se Show how 4a 2 got the answer F helps me. understand H better Thant you So much Problem 1 REGIONAL AIRLINES Regional Airlines is establishing a new telephone system for handling flight reservations. During the 10:00 A.M. to 11:00 A.M. time period, calls to the reservation agent occur ran- domly at an average of one call every 3.75 minutes. Historical service time data show that a reservation agent spends an average of 3 minutes with each...

  • Creating a simple graph in C++; need solution ASAP. EDIT: Pls comment letting me know what...

    Creating a simple graph in C++; need solution ASAP. EDIT: Pls comment letting me know what other information you need rather than just "..." Thank you. Here is the assignment: In this final practice problem, you’ll: read a set of data representing a directed, unweighted graph build an in-memory graph structure using the data display the graph using depth-first traversal display the graph using breadth-first traversal Input data - The data consists of records like this: 16 3 15 4...

  • JAVA 3 PLEASE ANSWER AS MANY QUESTIONS AS POSSIBLE! ONLY 2 QUESTIONS LEFT THIS MONTH!!! Question...

    JAVA 3 PLEASE ANSWER AS MANY QUESTIONS AS POSSIBLE! ONLY 2 QUESTIONS LEFT THIS MONTH!!! Question 12 pts Which is a valid constructor for Thread? Thread ( Runnable r, int priority ); Thread ( Runnable r, String name ); Thread ( int priority ); Thread ( Runnable r, ThreadGroup g ); Flag this Question Question 22 pts What method in the Thread class is responsible for pausing a thread for a specific amount of milliseconds? pause(). sleep(). hang(). kill(). Flag...

  • Programming Traversal Methods in C++ (depth first & breadth first) Need solution ASAP any help is...

    Programming Traversal Methods in C++ (depth first & breadth first) Need solution ASAP any help is much appreciated. read a set of data representing a directed, unweighted graph build an in-memory graph structure using the data display the graph using depth-first traversal display the graph using breadth-first traversal Input data - The data consists of records like this: 16 3 15 4 -1 This represents a vertex 16 with neighbors 3, 15, and 4. The -1 is the indicator that...

  • Town of Eden Bay The town of Eden Bay owns and maintains a fleet of vehicles....

    Town of Eden Bay The town of Eden Bay owns and maintains a fleet of vehicles. You are a systems analyst reporting to Dawn, the town’s IT manager. Background Eden Bay is a medium-sized municipality. The town has grown rapidly, and so has the demand for town services. Eden Bay currently owns 90 vehicles, which the town’s equipment department maintains. The fleet includes police cars, sanitation trucks, fire trucks, and other vehicles assigned to town employees. The maintenance budget has...

  • QUESTION: DATA FOR QUESTION: 52 You need to use cell referencing so I can track your...

    QUESTION: DATA FOR QUESTION: 52 You need to use cell referencing so I can track your calculations in Excel and to perform what-if analysis for E. 53 54 a. Determine the monthly operating costs of a machine when cost assignments are 55 based on the number of machines. Conceptually this is like the plantwide overhead rate per unit. 56 Hint: Do not make this complicated, since you are given the total overhead cost and know there are 10 machines. A...

  • Edit a C program based on the surface code(which is after the question's instruction.) that will...

    Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....

  • Solve it for java Question Remember: You will need to read this assignment many times to...

    Solve it for java Question Remember: You will need to read this assignment many times to understand all the details of the you need to write. program Goal: The purp0se of this assignment is to write a Java program that models an elevator, where the elevator itself is a stack of people on the elevator and people wait in queues on each floor to get on the elevator. Scenario: A hospital in a block of old buildings has a nearly-antique...

  • You are a member of a QIT that was asked to evaluate the appointment/scheduling process. Are there some "assumptions" in...

    You are a member of a QIT that was asked to evaluate the appointment/scheduling process. Are there some "assumptions" in the narrative that you question? If data were sufficient for a Pareto diagram of problems with the appointment/scheduling process, what do you think the items would be? Please list them. Case Study: The Carbondale Clinic, located in Carbondale, Illinois, is a large group practice of about 30 physicians. The clinic employs about I00 people and serves a regional population of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT