"""Static EDF. A DVFS variant of EDF (uniprocessor)."""fromsimso.coreimportSchedulerclassStatic_EDF(Scheduler):definit(self):self.ready_list=[]# Compute processor speedutilization=sum([t.wcet/t.periodfortinself.task_list],0.0)self.processors[0].set_speed(utilization)defon_activate(self,job):self.ready_list.append(job)job.cpu.resched()defon_terminated(self,job):self.ready_list.remove(job)job.cpu.resched()defschedule(self,cpu):ifself.ready_list:# job with the highest priorityjob=min(self.ready_list,key=lambdax:x.absolute_deadline)else:job=Nonereturn(job,cpu)