"""Rate Monotic algorithm for uniprocessor architectures."""fromsimso.coreimportSchedulerclassRM_mono(Scheduler):definit(self):self.ready_list=[]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.period)else:job=Nonereturn(job,cpu)