def ts_test(ts): #global b_np_qpa for t in ts: t.wss = 0 if edf.is_schedulable(1, ts): return 1 return 0
def test_edf_schedulable(self): self.ts.append(tasks.SporadicTask(10, 100, deadline=15)) self.assertFalse(edf.is_schedulable(1, self.ts))
def test_edf_schedulable(self): self.assertTrue(edf.is_schedulable(1, self.ts))
def ts_test(ts): global b global b_lp global b_np #global b_np_qpa global avg_np global max_np global avg_lp global max_lp global avg_p global max_p global printed_example o_np_avg = m.Overheads() o_np_avg.zero_overheads() o_np_avg.ctx_switch = const(27) o_np_max = m.Overheads() o_np_max.zero_overheads() o_np_max.ctx_switch = const(44) o_p_avg = m.Overheads() o_p_avg.zero_overheads() o_p_avg.ctx_switch = const(263) o_p_max = m.Overheads() o_p_max.zero_overheads() o_p_max.ctx_switch = const(434) for t in ts: t.wss = 0 ts_np = make_np(ts.copy()) ts_lp = make_lp(ts.copy()) ts_np_avg = charge_sched_overheads_np(o_np_avg, ts_np.copy()) ts_np_max = charge_sched_overheads_np(o_np_max, ts_np.copy()) ts_lp_avg = fp.charge_scheduling_overheads(o_np_avg, 1, False, ts_lp.copy()) ts_lp_max = fp.charge_scheduling_overheads(o_np_max, 1, False, ts_lp.copy()) ts_p_avg = fp.charge_scheduling_overheads(o_p_avg, 1, False, ts.copy()) ts_p_max = fp.charge_scheduling_overheads(o_p_max, 1, False, ts.copy()) if edf.is_schedulable(1, ts): b += 1 #if edf.is_schedulable(1, ts, preemptive=False): # b_np += 1 if edf.is_schedulable(1, ts_lp): b_lp += 1 if edf.is_schedulable(1, ts_np): b_np += 1 if edf.is_schedulable(1, ts_np_avg): avg_np += 1 if edf.is_schedulable(1, ts_np_max): max_np += 1 if edf.is_schedulable(1, ts_lp_avg): avg_lp += 1 if edf.is_schedulable(1, ts_lp_max): max_lp += 1 if edf.is_schedulable(1, ts_p_avg): avg_p += 1 if edf.is_schedulable(1, ts_p_max): max_p += 1
def test_edf_not_schedulable(self): self.ts.append(tasks.SporadicTask(100, 1100)) self.assertTrue(edf.is_schedulable(1, self.ts))
def test_edf_not_schedulable(self): self.ts.append(tasks.SporadicTask( 10, 100, deadline=15)) self.assertFalse(edf.is_schedulable(1, self.ts))