-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Operations-Research-lib/develop
update readme and add mm1 unit test
- Loading branch information
Showing
5 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
otherthings.md | ||
practica.py | ||
other.py | ||
src/__pycache__/queueing_theory.cpython-312.pyc | ||
src/__pycache__/test_queueing_theory.cpython-312-pytest-7.4.3.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Module providing unit test for queueing_theory""" | ||
import math as ma | ||
|
||
import queueing_theory as qt | ||
|
||
|
||
class TestMm1: | ||
"""Class to test the M/M/1 queueing model""" | ||
|
||
def test_mm1_model_compute_rho(self): | ||
""" | ||
Test case for mm1_model_compute_rho function. | ||
This function tests the calculation of rho (traffic intensity) in the M/M/1 | ||
queueing model. | ||
It verifies that the calculated value of rho is not equal to 0 and is | ||
approximately equal to 0.8. | ||
""" | ||
lam_input = 8 | ||
miu_input = 10 | ||
expected_output = 0.8 | ||
rho_calc = qt.mm1_model_compute_rho(lam = lam_input, miu = miu_input) | ||
|
||
assert rho_calc != 0, "rho is equal to 0" | ||
assert ma.isclose(rho_calc, expected_output, | ||
rel_tol=1e-9), "rho is not approximately equal to 0.8" |