Simulation of HRRN/HECN Scheduling Policy

Simulation of HRRN/HECN Scheduling Policy ADVANCE OPERATING SYSTEM PROGRAMMING ASSIGNMENT Background: In this assignment you are expected to simulate Intra-core scheduling using preemptive Round Robin with priority of HRRN and HECN. For further information consult with the lecture notes (available on TRACS), with the relevant text in the book, and the relevant slides. For ????????????????????, the priority of task ???? , use: ????????????????????=????????+????????????????. For ????????????????????, the power aware priority of task ????????, use: ????????????????????=????????+????????×????????????????????×????????????. Where: ???????? is the remaining execution time of ????????, ???????? is the total wait time (time spent in the ready Que and in the I/O Queue) of ????????, and ???????????? is the average power consumption of ????????, Please make the following assumptions: 1) The scheduling policy is HRRN (run 1) and HECN (run 2). 2) The state of the system can change at any tick (end of a tick). 3) OS decisions and actions are done only at the end of a slice. A slice is 20 ticks. 4) Tasks are generated (at any tick) with a probability ????1. 5) The remaining execution time of a task is denoted by ????3. If ????3=0, the task terminates. 6) The average power consumption of a task is denoted by ????4. 7) The running task can incur an I/O event (at any tick) with a probability ????2 8) The length of an I/O event is denoted by ????5. If ????5=0, the I/O event is completed. Assignment Instructions: Write a simulation of the HRRN/HECN scheduling policy. Your program should use a random number generator that generates random numbers {????1,2,????3,????4,????5} in the range [0, 1] and augment the number as needed to get the ranges specified below. 1. ????1=1 if ????1>0.97; otherwise ????1=0 2. ????2=1 if ????2>0.97; otherwise ????2=0 3. ????3∈[10,50]; ????4∈[10,30],????5∈[5,15]. 4. The simulation should run for 1500 ticks for HRRN (run 1) and 1500 ticks for HECN (run 2) and produce a screen-shot of the system throughput (number of completed tasks divided by the simulation length), total energy dissipated (????=????×????) in run 2, and the average latency per task (in ticks).