Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help coding this program using c++. 2018 Fall CIS200- Program 4 Release date: November 26, 2018 Due date: December 3 and December 10,

i need help coding this program using c++.

image text in transcribed

image text in transcribed

2018 Fall CIS200- Program 4 Release date: November 26, 2018 Due date: December 3 and December 10, 2018 ram will simulate a processor using a binary heap priority queue. The jobs to be processed following arrival times with specific processing time units. will be arriving into the system on a random basis based on the Arrival Time Processing Time 3 +/-2 8 +/-2 13 +/-2 "Regular" jobs: A 10 +/- 1 25 +/-1 "Highest Priority" jobs: 30 +/-5 10 +/-2 Note: 5 +/- 1 is 4, 5, 6 4 + rand()%3 30 +/-5 is 25 to 35-) 25 + rand( )%11 To start there is one processor with a priority queue to hold all jobs that have not started. Upon arrival, a job will begin processing if no current job is executing or, if a job is currently in process, be placed on the priority queue based on processing time. Once a job starts executing it runs to completion unless a "Highest Priority" interrupts the running job. The interrupted job is removed from the processor and the remaining time is calculated and job placed back into the priority queue based on the new processing time. Data for each job: job type, overall job number, job type number, processing time You are to determine and capture a set of metrics that will determine how well the system is performing Sample Metrics: Queue size: Average queue size: time units Total number of jobs A arrived: Total number of jobs B arrived: Total number of jobs c arrived: Jobs interrupted Total jobs completed Number of processor (s) used Total number of time units the processors (s) run Total time processor (s) spent processing is time units You are to evaluate the metrics you collect and determine how many processors should be used to process jobs most effectively. High number of jobs in the queue (i.e. long wait times to process) and a continually empty queue are an ineffective processing environment. The simulation should run for 500 time units to "pre-fill" system with jobs, report metrics of queue size then continue to run for an additional 9500 time units and then report final metrics. For each program run you are to create a log file of actions. 1) Heap Empty: CPU 1 Idle time; cPU 2 Idle time; CPU 3 Idle time; 2) Heap Empty; CPU 1 Idle time; CPU 2 Idle time; CPU 3 Idle time 3) Heap Empty; CPU 1 Idle time; CPU 2 Idle time; CPU 3 Idle time; 4) Heap Empty; CPU 1 Idle time; CPU 2 Idle time; CPU 3 Idle time; 5) Arrival Job A: Overall Job 1, Job A 1, Processing time 5; Begin Processing Job A 1 CPU 1 -end time 9; Heap Empty: CPU 2 Idle time; CPU 3 Idle time; 6) Heap Empty, CPU 2 Idle time; CPU 3 Idle time; 7) Heap Empty, CPU 2 Idle time; CPU 3 Idle time; 8) Heap Empty, CPU 2 Idle time; CPU 3 Idle time; 9) Job A 1 Completes; Heap Empty; CPU 2 Idle time; CPU 3 Idle time; 10) Arrival Job A: Overall Job 2, Job A 2, Processing time 4; Begin Processing Job A 2 CPU 1; Heap Empty; CPU 2 Idle time; cPU 3 Idle time; 11) Arrival Job B: Overall Job 3, Job B 1, Processing time 8; Begin Processing Job B 1 CPU 2; Heap Empty: CPU 3 Idle time 12) CPU 3 Idle time; 13) Job A 2 Completed; CPU 1 Idle time: CPU 3 Idle time; 7679) Arrival Job D: Overall Job 3038, Job D 256, Processing time 12; Interrupt job A 1535, Interrupted jobs: 157, New high priority job goes into Processor Job A 1535 Added to queue with processing time 1 7680). In addition to the normal turn-in document, you are to submit a write up on your review of the run with one processor and your analysis and additional runs to determine the number of processors to run the system most efficiently

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions