def insideroutine(numberOfRuns, fr): c_prob = [] seq_prob = [] for i in range(numberOfRuns): tasks = [] tasks = task_generator.taskGeneration_p(20, 60) tasks = mixed_task_builder.hardtaskWCET(tasks, 1.83, fr) print tasks #the following part is for testing #c_prob.append(cprta.cprta(tasks)) seq_prob.append(EPST.probabilisticTest_p(tasks, 3, 3)) return [c_prob, seq_prob]
def insideroutine(numberOfRuns, fr): seq_prob = [] for i in range(numberOfRuns): tasks = [] tasks = task_generator.taskGeneration_p(10, 60) tasks = mixed_task_builder.hardtaskWCET(tasks, 1.83, fr) keepTasks = tasks[:] #the following part is for testing resP = EPST.probabilisticTest_p(tasks, 3, 3) seq_prob.append( resP ) #this will get the maximum probability among the tasks in a task set. return seq_prob
def taskset_gen_with_tda(utilization, hard_task_factor, fault_rate, num_task): while True: if rounded is True: tasks = task_generator.taskGeneration_rounded( num_task, utilization) else: tasks = task_generator.taskGeneration_p(num_task, utilization) tasks = mixed_task_builder.mixed_task_set(tasks, hard_task_factor, fault_rate) tasks = mixed_task_builder.pdfForm(tasks) if TDA.TDAtest(tasks) == 0: break else: pass return tasks
def insideroutine(numberOfRuns, fr, tib): seq_prob = [] for i in range(numberOfRuns): tasks=[] tasks=task_generator.taskGeneration_p(tib,60) tasks=mixed_task_builder.hardtaskWCET(tasks, 1.83, fr) keepTasks = tasks[:] #the following part is for testing timing.tlog_start("CPRTA starts", 0 ) resEPSTK = cprta.cprta(tasks) timing.tlog_end("CPRTA ends", stampCPRTA, 0) timing.tlog_start("EPST method starts", 0) resEPST = EPST.probabilisticTest_ptda_pt(tasks, nd, 3) #no opt timing.tlog_end("EPST method ends", stampEPST, 0) timing.tlog_start("EPSTK starts", 0 ) resEPSTK = EPST.probabilisticTest_pt(tasks, nd, 3) #no opt timing.tlog_end("EPSTK ends", stampEPSTK, 0) return seq_prob
file.write('Utilization: ' + repr(60) + '\n') for htf in hardTaskFactor: for nd in numDeadline: for percentageU in range(60, 61, 10): for fr in faultRate: numberOfRuns = 500 print('Tasks: ' + repr(tib) + ', NumDeadline:' + repr(nd) + ', FaultRate:' + repr(fr)) + ', Utilization:' + repr(percentageU) for i in range(numberOfRuns): print "sample: ", i file.write('Generated ' + repr(tib) + 'samples:' + repr(i) + '\n') tasks = [] tasks = task_generator.taskGeneration_p( tib, percentageU) tasks = mixed_task_builder.hardtaskWCET(tasks, htf, fr) keepTasks = tasks[:] for k in tasks: file.write(repr(k) + ',') file.write('\n') #the following part is for testing timing.tlog_start("CPRTA starts", 1) resEPSTK = cprta.cprtao(tasks) timing.tlog_end("CPRTA ends", stampCPRTA, 1) if len(stampCPRTA) > 0: file.write('Duration: ' + repr(stampCPRTA[-1]) + '\n')
keepsTasks=[] numberOfRuns = 100 c_prob = [] seq_prob = [] for j in tasksinBkt: fileName = 'mp_tasks'+repr(j)+'_utilization'+repr(60) folder = 'comparison/' file = open(folder + 'txt/' + fileName + '.txt', "w") file.write('Num of deadline miss: ' + repr(1) + '\n') file.write('Utilization: '+repr(60) + '\n') for i in range(numberOfRuns): print "Sample", i file.write('Generated '+ repr(j) +'samples:'+repr(i)+'\n') tasks=[] tasks=task_generator.taskGeneration_p(j,60) tasks=mixed_task_builder.hardtaskWCET(tasks, 1.83, 10**-6.) keepsTasks=tasks[:] for k in tasks: file.write(repr(k) + ',') file.write('\n') #the following part is for testing file.write('DMP:\n') tdar = EPST.probabilisticTest_po(tasks, 3, 10) cpa = cprta.cprtao(keepsTasks) if tdar < cpa: file.write('bug?\n') file.write('EPST-K:\n') file.write(repr(tdar) + ',')