Question
Write a function that applies the slack time remaining (STR) sequencing rule to a given collection of jobs. Although this rule has not been covered
Write a function that applies the” slack time remaining” (STR) sequencing rule to a given collection of jobs. Although this rule has not been covered in class, its application is very similar to the critical ratio. You need to calculate the STR value for all jobs and schedule 1 the one with the lowest STR. Continue this until all jobs are scheduled. The STR values are calculated as follows: ST R = [Time Until Due Date] − [P processing T ime] If you have more than 1 job with the lowest STR, break ties with Earliest Due Date (EDD) rule. If due dates are also the same, schedule the one that arrived earlier (that means the one in the upper rows of the table.)
Your function will accept a single parameter as a pandas data frame: Function Parameter: df jobs: A pandas data frame whose indexes are the names of the jobs. Jobs are assumed to arrive on the same day in the same order given in the data frame. There will be two data columns in the data frame(same as the examples covered in class): ”Processing Time”: Processing time required for the job ”Due Date”: Time between the arrival of the job and the due date of the job. Output: Your function should return a list containing the correct sequence according to the STR rule. Example inputs and expected outputs: Example Input Data:
Job Processing Time Due Date
A 2 7
B 8 16
C 4 4
D 10 17
E 5 15
F 12 18
Expected Output: [’ C’, ’A’, ’F’, ’D’, ’B’, ’E’] in python programming language use NumPy and pandas.
Step by Step Solution
3.39 Rating (140 Votes )
There are 3 Steps involved in it
Step: 1
The code will s...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started