Пример #1
0
    def test_bound_is_integral(self):
        self.assertTrue(da.bound_response_times(2, self.ts))
        self.assertTrue(is_integral(self.ts[0].response_time))
        self.assertTrue(is_integral(self.ts[1].response_time))
        self.assertTrue(is_integral(self.ts[2].response_time))

        self.assertFalse(da.bound_response_times(1, self.ts))
Пример #2
0
    def test_bound_is_integral(self):
        self.assertTrue(da.bound_response_times(2, self.ts))
        self.assertTrue(is_integral(self.ts[0].response_time))
        self.assertTrue(is_integral(self.ts[1].response_time))
        self.assertTrue(is_integral(self.ts[2].response_time))

        self.assertFalse(da.bound_response_times(1, self.ts))
Пример #3
0
    def test_release_delay(self):
        q.account_for_delayed_release(101, self.ts)
        q.quantize_period(self.qlen, self.ts)
        self.assertEqual(self.ts[0].cost, 100)
        self.assertEqual(self.ts[1].cost, 39)
        self.assertEqual(self.ts[2].cost, 51)

        self.assertTrue(is_integral(self.ts[0].period))
        self.assertTrue(is_integral(self.ts[1].period))
        self.assertTrue(is_integral(self.ts[2].period))

        self.assertEqual(self.ts[0].period, 850)
        self.assertEqual(self.ts[1].period, 900)
        self.assertEqual(self.ts[2].period, 450)
Пример #4
0
    def test_release_delay(self):
        q.account_for_delayed_release(101, self.ts)
        q.quantize_period(self.qlen, self.ts)
        self.assertEqual(self.ts[0].cost, 100)
        self.assertEqual(self.ts[1].cost,  39)
        self.assertEqual(self.ts[2].cost,  51)

        self.assertTrue(is_integral(self.ts[0].period))
        self.assertTrue(is_integral(self.ts[1].period))
        self.assertTrue(is_integral(self.ts[2].period))

        self.assertEqual(self.ts[0].period,  850)
        self.assertEqual(self.ts[1].period,  900)
        self.assertEqual(self.ts[2].period,  450)
Пример #5
0
    def test_period(self):
        q.quantize_period(self.qlen, self.ts)
        self.assertEqual(self.ts[0].cost, 100)
        self.assertEqual(self.ts[1].cost, 39)
        self.assertEqual(self.ts[2].cost, 51)

        self.assertTrue(is_integral(self.ts[0].period))
        self.assertTrue(is_integral(self.ts[1].period))
        self.assertTrue(is_integral(self.ts[2].period))

        self.assertEqual(self.ts[0].period, 1000)
        self.assertEqual(self.ts[1].period, 1050)
        self.assertEqual(self.ts[2].period, 550)

        self.assertEqual(self.ts[0].deadline, 1000)
        self.assertEqual(self.ts[1].deadline, 1050)
        self.assertEqual(self.ts[2].deadline, 599)
Пример #6
0
    def test_ewcet(self):
        q.quantize_wcet(self.qlen, self.ts, effective_qlen=25)
        self.assertEqual(self.ts[0].cost, 200)
        self.assertEqual(self.ts[1].cost, 100)
        self.assertEqual(self.ts[2].cost, 150)

        self.assertTrue(is_integral(self.ts[0].cost))
        self.assertTrue(is_integral(self.ts[1].cost))
        self.assertTrue(is_integral(self.ts[2].cost))

        self.assertEqual(self.ts[0].period, 1000)
        self.assertEqual(self.ts[1].period, 1050)
        self.assertEqual(self.ts[2].period, 599)

        self.assertEqual(self.ts[0].deadline, 1000)
        self.assertEqual(self.ts[1].deadline, 1050)
        self.assertEqual(self.ts[2].deadline, 599)
Пример #7
0
    def test_period(self):
        q.quantize_period(self.qlen, self.ts)
        self.assertEqual(self.ts[0].cost, 100)
        self.assertEqual(self.ts[1].cost,  39)
        self.assertEqual(self.ts[2].cost,  51)

        self.assertTrue(is_integral(self.ts[0].period))
        self.assertTrue(is_integral(self.ts[1].period))
        self.assertTrue(is_integral(self.ts[2].period))

        self.assertEqual(self.ts[0].period, 1000)
        self.assertEqual(self.ts[1].period, 1050)
        self.assertEqual(self.ts[2].period,  550)

        self.assertEqual(self.ts[0].deadline, 1000)
        self.assertEqual(self.ts[1].deadline, 1050)
        self.assertEqual(self.ts[2].deadline,  599)
Пример #8
0
    def test_ewcet(self):
        q.quantize_wcet(self.qlen, self.ts, effective_qlen=25)
        self.assertEqual(self.ts[0].cost, 200)
        self.assertEqual(self.ts[1].cost, 100)
        self.assertEqual(self.ts[2].cost, 150)

        self.assertTrue(is_integral(self.ts[0].cost))
        self.assertTrue(is_integral(self.ts[1].cost))
        self.assertTrue(is_integral(self.ts[2].cost))

        self.assertEqual(self.ts[0].period, 1000)
        self.assertEqual(self.ts[1].period, 1050)
        self.assertEqual(self.ts[2].period, 599)

        self.assertEqual(self.ts[0].deadline, 1000)
        self.assertEqual(self.ts[1].deadline, 1050)
        self.assertEqual(self.ts[2].deadline, 599)
Пример #9
0
 def test_integral(self):
     self.assertTrue(m.is_integral(int(1)))
     self.assertTrue(m.is_integral(int(1)))
     self.assertFalse(m.is_integral("foo"))
     self.assertFalse(m.is_integral(1.0))
     self.assertFalse(m.is_integral(20 / 1))
     self.assertFalse(m.is_integral(Fraction(100, 10)))
Пример #10
0
 def test_integral(self):
     self.assertTrue(m.is_integral(int(1)))
     self.assertTrue(m.is_integral(long(1)))
     self.assertFalse(m.is_integral("foo"))
     self.assertFalse(m.is_integral(1.0))
     self.assertFalse(m.is_integral(20 / 1))
     self.assertFalse(m.is_integral(Fraction(100, 10)))
Пример #11
0
 def test_bound_is_integral(self):
     self.assertTrue(rta.is_schedulable(1, self.ts))
     self.assertTrue(is_integral(self.ts[0].response_time))
     self.assertTrue(is_integral(self.ts[1].response_time))
     self.assertTrue(is_integral(self.ts[2].response_time))
Пример #12
0
 def test_bound_is_integral(self):
     self.assertTrue(ber.is_schedulable(3, self.ts, dont_use_slack=True))
     self.assertTrue(is_integral(self.ts[0].response_time))
     self.assertTrue(is_integral(self.ts[1].response_time))
     self.assertTrue(is_integral(self.ts[2].response_time))
     self.assertTrue(is_integral(self.ts[3].response_time))
Пример #13
0
 def test_bound_is_integral(self):
     self.assertTrue(rta.is_schedulable(1, self.ts))
     self.assertTrue(is_integral(self.ts[0].response_time))
     self.assertTrue(is_integral(self.ts[1].response_time))
     self.assertTrue(is_integral(self.ts[2].response_time))
Пример #14
0
 def test_bound_is_integral(self):
     self.assertTrue(ber.is_schedulable(3, self.ts, dont_use_slack=True))
     self.assertTrue(is_integral(self.ts[0].response_time))
     self.assertTrue(is_integral(self.ts[1].response_time))
     self.assertTrue(is_integral(self.ts[2].response_time))
     self.assertTrue(is_integral(self.ts[3].response_time))