"""Partitionned EDF using PartitionedScheduler.Try to load balance the tasks among the processors."""fromsimso.core.SchedulerimportSchedulerInfofromEDF_monoimportEDF_monofromsimso.utilsimportPartitionedSchedulerclassLB_P_EDF(PartitionedScheduler):definit(self):PartitionedScheduler.init(self,SchedulerInfo("EDF_mono",EDF_mono))defpacker(self):# First Fitcpus=[[cpu,0]forcpuinself.processors]fortaskinself.task_list:m=cpus[0][1]j=0# Find the processor with the lowest load.fori,cinenumerate(cpus):ifc[1]<m:m=c[1]j=i# Affect it to the task.self.affect_task_to_processor(task,cpus[j][0])# Update utilization.cpus[j][1]+=float(task.wcet)/task.periodreturnTrue