def test_departure_process(self): q1 = MapPh1N(MAP.exponential(1.0), PhaseType.exponential(2.0), 20) q2 = MapPh1N(MAP.erlang(4, 1.0), PhaseType.erlang(3, 2.0), 20) self.assertIsInstance(q1.departure, MAP) self.assertIsInstance(q2.departure, MAP) # Since queue is very long, arrival rate will be close to departure # rate. self.assertAlmostEqual(q1.departure.rate, q1.arrival_rate, 5) self.assertAlmostEqual(q2.departure.rate, q2.arrival_rate, 5)
def test_utilization(self): q1 = MapPh1N(MAP.exponential(1.0), PhaseType.exponential(2.0), 20) q2 = MapPh1N(MAP.erlang(4, 1.0), PhaseType.erlang(3, 2.0), 20) self.assertAlmostEqual(q1.utilization, 1 / 2) self.assertAlmostEqual(q2.utilization, 3 / 8)