Please provide a Python implementation for this question.
This question involves implementing different process scheduling algorithms. The scheduler will be assigned a predefined set of tasks and will schedule the tasks based on the selected scheduling algorithm. Each task is assigned a priority and CPU burst. The following scheduling algorithms will be implemented:
a) First-come, first-served (FCFS), which schedules tasks in the order in which they request the CPU.
b) Shortest-job-first (SJF), which schedules tasks in order of the length of the tasks' next CPU burst.
c) Priority scheduling, which schedules tasks based on priority.
d) Round-robin (RR) scheduling, where each task is run for a time quantum (or for the remainder of its CPU burst).
Priorities range from 1 to 10, where a higher numeric value indicates a higher relative priority. For round-robin scheduling, the length of a time quantum is 10 milliseconds.
Implementation is to be completed in Python. Simple code to read the list from a file is below and available from D2L.
The schedule of tasks has the form [task name] [priority] [CPU burst], with the following example format:
T1,4,20 T2,2,25 T3,3,25 T4,3,15 T5,10,10
Thus, task T1 has priority 4 and a CPU burst of 20 milliseconds, and so forth. It is assumed that all tasks arrive at the same time, so your scheduler algorithms do not have to support higher-priority processes preempting processes with lower priorities. In addition, tasks do not have to be placed into a queue or list in any particular order.
The result of the scheduling code should be a list indicating the start time and duration of the CPU burst. For example, an FCFS output for the example tasks would be:
T1,0,20 T2,21,25 T3,46,25 T4,71,15 T5,86,10