most-queue 1.32__tar.gz → 1.34__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of most-queue might be problematic. Click here for more details.

Files changed (84) hide show
  1. {most_queue-1.32 → most_queue-1.34}/LICENSE +0 -0
  2. {most_queue-1.32 → most_queue-1.34}/PKG-INFO +104 -104
  3. {most_queue-1.32 → most_queue-1.34}/README.md +0 -0
  4. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/__init__.py +0 -0
  5. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/batch_sim.py +0 -34
  6. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/fj_delta_sim.py +3 -69
  7. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/fj_sim.py +0 -50
  8. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/flow_sum_sim.py +0 -0
  9. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/impatient_queue_sim.py +2 -28
  10. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/priority_network.py +1 -89
  11. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/priority_queue_sim.py +1 -70
  12. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/qs_sim.py +1 -47
  13. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/queue_finite_source_sim.py +0 -29
  14. {most_queue-1.32 → most_queue-1.34}/most_queue/sim/rand_destribution.py +6 -59
  15. {most_queue-1.32/most_queue → most_queue-1.34/most_queue/theory}/__init__.py +0 -0
  16. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/batch_mm1.py +0 -19
  17. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/convolution_sum_calc.py +0 -0
  18. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/diff5dots.py +0 -0
  19. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/ek_d_n_calc.py +1 -27
  20. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/engset_model.py +2 -45
  21. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/fj_calc.py +8 -113
  22. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/flow_sum.py +6 -2
  23. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/generate_pareto_noise.py +4 -1
  24. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/gi_m_1_calc.py +4 -63
  25. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/gi_m_n_calc.py +4 -66
  26. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/impatience_calc.py +0 -0
  27. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/m_d_n_calc.py +0 -21
  28. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/m_h2_h2warm.py +4 -86
  29. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/m_ph_n_prty.py +2 -142
  30. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/mg1_calc.py +3 -73
  31. most_queue-1.34/most_queue/theory/mg1_warm_calc.py +30 -0
  32. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/mgn_tt.py +1 -56
  33. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/mgn_with_h2_delay_cold_warm.py +2 -120
  34. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/mmn3_pnz_cox_approx.py +22 -86
  35. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/mmn_prty_pnz_approx.py +2 -64
  36. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/mmn_with_h2_cold_and_h2_warmup.py +5 -94
  37. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/mmnr_calc.py +3 -2
  38. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/network_calc.py +3 -3
  39. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/network_viewer.py +0 -0
  40. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/passage_time.py +41 -41
  41. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/priority_calc.py +4 -4
  42. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/q_poisson_arrival_calc.py +1 -1
  43. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/student_stat.py +0 -0
  44. {most_queue-1.32 → most_queue-1.34}/most_queue/theory/weibull.py +1 -1
  45. {most_queue-1.32/most_queue/tests → most_queue-1.34/most_queue/utils}/__init__.py +0 -0
  46. {most_queue-1.32 → most_queue-1.34}/most_queue/utils/approx_cdf_make.py +1 -1
  47. {most_queue-1.32 → most_queue-1.34}/most_queue/utils/binom_probs.py +0 -0
  48. {most_queue-1.32 → most_queue-1.34}/most_queue/utils/tables.py +0 -0
  49. {most_queue-1.32 → most_queue-1.34}/most_queue.egg-info/PKG-INFO +104 -104
  50. {most_queue-1.32 → most_queue-1.34}/most_queue.egg-info/SOURCES.txt +1 -27
  51. {most_queue-1.32 → most_queue-1.34}/most_queue.egg-info/dependency_links.txt +0 -0
  52. {most_queue-1.32 → most_queue-1.34}/most_queue.egg-info/not-zip-safe +0 -0
  53. most_queue-1.34/most_queue.egg-info/top_level.txt +1 -0
  54. {most_queue-1.32 → most_queue-1.34}/pyproject.toml +1 -1
  55. {most_queue-1.32 → most_queue-1.34}/setup.cfg +4 -4
  56. {most_queue-1.32 → most_queue-1.34}/setup.py +1 -1
  57. most_queue-1.32/most_queue/tests/ek_d_n.py +0 -66
  58. most_queue-1.32/most_queue/tests/fj_calc.py +0 -114
  59. most_queue-1.32/most_queue/tests/fj_im.py +0 -103
  60. most_queue-1.32/most_queue/tests/flow_sum.py +0 -95
  61. most_queue-1.32/most_queue/tests/gi_m_1_calc.py +0 -110
  62. most_queue-1.32/most_queue/tests/gi_m_n_calc.py +0 -113
  63. most_queue-1.32/most_queue/tests/m_d_n_calc.py +0 -52
  64. most_queue-1.32/most_queue/tests/m_h2_h2warm.py +0 -73
  65. most_queue-1.32/most_queue/tests/m_ph_n_prty.py +0 -152
  66. most_queue-1.32/most_queue/tests/mg1_calc.py +0 -83
  67. most_queue-1.32/most_queue/tests/mg1_warm_calc.py +0 -29
  68. most_queue-1.32/most_queue/tests/mgn_tt.py +0 -84
  69. most_queue-1.32/most_queue/tests/mmn3_pnz_cox_approx.py +0 -79
  70. most_queue-1.32/most_queue/tests/mmn_prty_pnz_approx.py +0 -68
  71. most_queue-1.32/most_queue/tests/network_im_prty.py +0 -127
  72. most_queue-1.32/most_queue/tests/smo_im.py +0 -58
  73. most_queue-1.32/most_queue/tests/smo_im_prty.py +0 -105
  74. most_queue-1.32/most_queue/tests/weibull.py +0 -33
  75. most_queue-1.32/most_queue/theory/__init__.py +0 -1
  76. most_queue-1.32/most_queue/theory/mg1_warm_calc.py +0 -54
  77. most_queue-1.32/most_queue/utils/__init__.py +0 -0
  78. most_queue-1.32/most_queue/visualisation/__init__.py +0 -0
  79. most_queue-1.32/most_queue/visualisation/smo_im_vis.py +0 -959
  80. most_queue-1.32/most_queue/visualisation/utils/__init__.py +0 -0
  81. most_queue-1.32/most_queue/visualisation/utils/result_table.py +0 -78
  82. most_queue-1.32/most_queue/visualisation/utils/settings_window.py +0 -357
  83. most_queue-1.32/most_queue/visualisation/utils/splash_screen.py +0 -49
  84. most_queue-1.32/most_queue.egg-info/top_level.txt +0 -1
File without changes
@@ -1,104 +1,104 @@
1
- Metadata-Version: 2.1
2
- Name: most_queue
3
- Version: 1.32
4
- Summary: Software package for calculation and simulation of queuing systems
5
- Home-page: https://github.com/xabarov/mps
6
- Author: Xabarov Roman
7
- Author-email: Xabarov Roman <xabarov1985@gmail.com>
8
- License: Copyright (c) 2018 The Python Packaging Authority
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
- Project-URL: Homepage, https://github.com/xabarov/mps
28
- Classifier: Programming Language :: Python :: 3
29
- Classifier: License :: OSI Approved :: MIT License
30
- Classifier: Operating System :: OS Independent
31
- Requires-Python: >=3.7
32
- Description-Content-Type: text/markdown
33
- License-File: LICENSE
34
-
35
- # most_queue
36
- Python package for calculation and simulation of queuing systems (QS) and networks
37
-
38
- ## Authors
39
- - [xabarov](https://github.com/xabarov)
40
-
41
- ## Installation
42
- Install most-queue with pip
43
- ```bash
44
- pip install most-queue
45
- ```
46
-
47
- ## DESCRIPTION
48
- Most_queue consists of two main parts:
49
- - **.theory** contains programs that implement methods for calculating queuing theory models.
50
- - **.sim** contains simulation programs.
51
-
52
- ### Package .theory
53
- | # | Package name | Description |
54
- |-----|-----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
55
- | 1. | diff5dots | Numerical calculation of the derivative of a function |
56
- | 2. | fj_calc | Numerical calculation of the initial moments of the random variables maximum distribution |
57
- | 3. | m_ph_n_prty | Numerical calculation of QS M/Ph/n with 2 classes and PR - priority. Based on the approximation of busy periods |
58
- | 4. | mg1_calc | Numerical calculation of QS M/G/1 |
59
- | 5. | gi_m_1_calc | Numerical calculation of QS GI/M/1 |
60
- | 6. | gi_m_n_calc | Numerical calculation of QS GI/M/n |
61
- | 7. | m_d_n_calc | Numerical calculation of QS M/D/n |
62
- | 8. | ek_d_n_calc | Numerical calculation of QS Ek/D/n |
63
- | 9. | mg1_warm_calc | Numerical calculation of QS M/G/1 with "warm-up" |
64
- | 10. | mgn_tt | Numerical calculation of QS M/H2/n by the Takahashi-Takami method with complex parameters when approximating the serving time by the H2 distribution |
65
- | 11. | mmn3_pnz_cox_approx | Calculation of QS M/M/2 with 3 classes, PR - priority by the Takahashi-Takami numerical method based on the approximation of busy period by the Cox distribution |
66
- | 12. | mmn_prty_pnz_approx | Calculation of QS M/M/2 with 2 classes, PR - priority by the Takahashi-Takami numerical method based on the approximation of the busy period by the Cox distribution |
67
- | 13. | mmnr_calc | Calculation of QS M/M/n/r |
68
- | 14. | network_calc | Calculation of queuing network with priorities in nodes |
69
- | 15. | passage_time | Calculation of the initial transition times between arbitrary tiers of the Markov chain |
70
- | 16. | priority_calc | A set of functions for calculating QS with priorities (single-channel, multi-channel). The multichannel calculation is carried out by the method of relation invariants |
71
- | 17. | student_stat | Calculation of confidence probability, confidence intervals for random variable with unknown RMS based on Student's t-distribution. |
72
- | 18. | convolution_sum_calc | Calculate the initial moments of sums of random variables |
73
- | 19. | weibull | Selection of Weibull distribution parameters, calculation of CDF, PDF, Tail values |
74
- | 20. | flow_sum | Flow summation, numerical calculation |
75
- | 21. | impatience_calc | Calculation of M/M/1 with exponential impatience |
76
- | 22. | batch_mm1 | Calculation of QS M/M/1 with batch arrival |
77
- | 23. | engset_model.py | Calculation of QS M/M/1 with finite sources |
78
- | 24. | generate_pareto_noise.py.py | Create noise by Pareto dist |
79
- | 25. | network_viewer.py | Utility to view network structure |
80
- | 26. | mmn_with_h2_cold_h2_warmup.py | Multichannel queuing system with exp serving time, H2 warm-up and H2 cold (vacations). The system uses complex parameters, which allows to calculate systems with arbitrary warm-up and cold variation coefficients |
81
- | 27. | mgn_with_h2_delay_cold_warm.py | Multichannel queuing system with H2 serving time, H2 warm-up, H2 cold delay and H2 cold (vacations). The system uses complex parameters, which allows you to calculate systems with arbitrary serving, warm-up, cold-delay and cold variation coefficients |
82
- ### Package .sim
83
- | # | Package name | Description |
84
- | ------------- |----------------------------|------------- |
85
- | 1. | fj_delta_sim | Simulation of QS fork-join with a delay in the start of processing between channels |
86
- | 2. | fj_sim | Simulation of QS with fork-join process |
87
- | 3. | priority_network | Simulation of queuing network with priorities in nodes |
88
- | 4. | rand_distribution | A set of functions and classes designed to generate a PRNG and select parameters for distributions H2, C2, Ek, Pa, Gamma |
89
- | 5. | qs_sim | Simulation of QS GI/G/m/n |
90
- | 6. | priority_queue_sim | Simulation of QS GI/G/m/n with priorities |
91
- | 7. | flow_sum_sim | Simulation of flow summation |
92
- | 8. | impatient_sim.py | Simulation of QS GI/G/m/n with impatience |
93
- | 9. | batch_sim.py | Simulation of QS GI/G/m/n with batch arrival |
94
- | 10. | queue_finite_source_sim.py | Simulation of QS GI/G/m/n with finite sources |
95
-
96
- ## Usage
97
- Look [here](https://github.com/xabarov/most-queue/tree/main/most_queue/tests) for examples
98
-
99
-
100
-
101
-
102
-
103
-
104
-
1
+ Metadata-Version: 2.1
2
+ Name: most_queue
3
+ Version: 1.34
4
+ Summary: Software package for calculation and simulation of queuing systems
5
+ Home-page: https://github.com/xabarov/mps
6
+ Author: Xabarov Roman
7
+ Author-email: Xabarov Roman <xabarov1985@gmail.com>
8
+ License: Copyright (c) 2018 The Python Packaging Authority
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Project-URL: Homepage, https://github.com/xabarov/mps
28
+ Classifier: Programming Language :: Python :: 3
29
+ Classifier: License :: OSI Approved :: MIT License
30
+ Classifier: Operating System :: OS Independent
31
+ Requires-Python: >=3.7
32
+ Description-Content-Type: text/markdown
33
+ License-File: LICENSE
34
+
35
+ # most_queue
36
+ Python package for calculation and simulation of queuing systems (QS) and networks
37
+
38
+ ## Authors
39
+ - [xabarov](https://github.com/xabarov)
40
+
41
+ ## Installation
42
+ Install most-queue with pip
43
+ ```bash
44
+ pip install most-queue
45
+ ```
46
+
47
+ ## DESCRIPTION
48
+ Most_queue consists of two main parts:
49
+ - **.theory** contains programs that implement methods for calculating queuing theory models.
50
+ - **.sim** contains simulation programs.
51
+
52
+ ### Package .theory
53
+ | # | Package name | Description |
54
+ |-----|-----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
55
+ | 1. | diff5dots | Numerical calculation of the derivative of a function |
56
+ | 2. | fj_calc | Numerical calculation of the initial moments of the random variables maximum distribution |
57
+ | 3. | m_ph_n_prty | Numerical calculation of QS M/Ph/n with 2 classes and PR - priority. Based on the approximation of busy periods |
58
+ | 4. | mg1_calc | Numerical calculation of QS M/G/1 |
59
+ | 5. | gi_m_1_calc | Numerical calculation of QS GI/M/1 |
60
+ | 6. | gi_m_n_calc | Numerical calculation of QS GI/M/n |
61
+ | 7. | m_d_n_calc | Numerical calculation of QS M/D/n |
62
+ | 8. | ek_d_n_calc | Numerical calculation of QS Ek/D/n |
63
+ | 9. | mg1_warm_calc | Numerical calculation of QS M/G/1 with "warm-up" |
64
+ | 10. | mgn_tt | Numerical calculation of QS M/H2/n by the Takahashi-Takami method with complex parameters when approximating the serving time by the H2 distribution |
65
+ | 11. | mmn3_pnz_cox_approx | Calculation of QS M/M/2 with 3 classes, PR - priority by the Takahashi-Takami numerical method based on the approximation of busy period by the Cox distribution |
66
+ | 12. | mmn_prty_pnz_approx | Calculation of QS M/M/2 with 2 classes, PR - priority by the Takahashi-Takami numerical method based on the approximation of the busy period by the Cox distribution |
67
+ | 13. | mmnr_calc | Calculation of QS M/M/n/r |
68
+ | 14. | network_calc | Calculation of queuing network with priorities in nodes |
69
+ | 15. | passage_time | Calculation of the initial transition times between arbitrary tiers of the Markov chain |
70
+ | 16. | priority_calc | A set of functions for calculating QS with priorities (single-channel, multi-channel). The multichannel calculation is carried out by the method of relation invariants |
71
+ | 17. | student_stat | Calculation of confidence probability, confidence intervals for random variable with unknown RMS based on Student's t-distribution. |
72
+ | 18. | convolution_sum_calc | Calculate the initial moments of sums of random variables |
73
+ | 19. | weibull | Selection of Weibull distribution parameters, calculation of CDF, PDF, Tail values |
74
+ | 20. | flow_sum | Flow summation, numerical calculation |
75
+ | 21. | impatience_calc | Calculation of M/M/1 with exponential impatience |
76
+ | 22. | batch_mm1 | Calculation of QS M/M/1 with batch arrival |
77
+ | 23. | engset_model.py | Calculation of QS M/M/1 with finite sources |
78
+ | 24. | generate_pareto_noise.py.py | Create noise by Pareto dist |
79
+ | 25. | network_viewer.py | Utility to view network structure |
80
+ | 26. | mmn_with_h2_cold_h2_warmup.py | Multichannel queuing system with exp serving time, H2 warm-up and H2 cold (vacations). The system uses complex parameters, which allows to calculate systems with arbitrary warm-up and cold variation coefficients |
81
+ | 27. | mgn_with_h2_delay_cold_warm.py | Multichannel queuing system with H2 serving time, H2 warm-up, H2 cold delay and H2 cold (vacations). The system uses complex parameters, which allows you to calculate systems with arbitrary serving, warm-up, cold-delay and cold variation coefficients |
82
+ ### Package .sim
83
+ | # | Package name | Description |
84
+ | ------------- |----------------------------|------------- |
85
+ | 1. | fj_delta_sim | Simulation of QS fork-join with a delay in the start of processing between channels |
86
+ | 2. | fj_sim | Simulation of QS with fork-join process |
87
+ | 3. | priority_network | Simulation of queuing network with priorities in nodes |
88
+ | 4. | rand_distribution | A set of functions and classes designed to generate a PRNG and select parameters for distributions H2, C2, Ek, Pa, Gamma |
89
+ | 5. | qs_sim | Simulation of QS GI/G/m/n |
90
+ | 6. | priority_queue_sim | Simulation of QS GI/G/m/n with priorities |
91
+ | 7. | flow_sum_sim | Simulation of flow summation |
92
+ | 8. | impatient_sim.py | Simulation of QS GI/G/m/n with impatience |
93
+ | 9. | batch_sim.py | Simulation of QS GI/G/m/n with batch arrival |
94
+ | 10. | queue_finite_source_sim.py | Simulation of QS GI/G/m/n with finite sources |
95
+
96
+ ## Usage
97
+ Look [here](https://github.com/xabarov/most-queue/tree/main/most_queue/tests) for examples
98
+
99
+
100
+
101
+
102
+
103
+
104
+
File without changes
@@ -81,37 +81,3 @@ class QueueingSystemBatchSim(QueueingSystemSimulator):
81
81
  break
82
82
 
83
83
 
84
- if __name__ == '__main__':
85
- from most_queue.theory.batch_mm1 import BatchMM1
86
-
87
- ls = [0.2, 0.3, 0.1, 0.2, 0.2]
88
- moments = [0.0, 0.0]
89
- for j in range(len(moments)):
90
- for i in range(len(ls)):
91
- moments[j] += pow(i + 1, j + 1)
92
- moments[j] /= len(ls)
93
-
94
- n = 1
95
- lam = 0.7
96
- ro = 0.8
97
- mu = lam * moments[0] / ro
98
- n_jobs = 1000000
99
-
100
- batch_calc = BatchMM1(lam, mu, ls)
101
-
102
- v1 = batch_calc.get_v1()
103
-
104
- qs = QueueingSystemBatchSim(n, ls)
105
-
106
- qs.set_sources(lam, 'M')
107
- qs.set_servers(mu, 'M')
108
-
109
- qs.run(n_jobs)
110
-
111
- v1_im = qs.v[0]
112
-
113
- print("\nЗначения среднего времени пребывания заявок в системе:\n")
114
-
115
- print("{0:^15s}|{1:^15s}|{2:^15s}".format("№ момента", "Числ", "ИМ"))
116
- print("-" * 45)
117
- print("{0:^16d}|{1:^15.5g}|{2:^15.5g}".format(1, v1, v1_im))
@@ -2,7 +2,7 @@ from fj_sim import ForkJoinSim
2
2
  from fj_sim import SubTask as SubTask
3
3
  from fj_sim import Task as Task
4
4
  from qs_sim import Server
5
- from most_queue.theory import convolution_sum_calc
5
+ from sim_utils import get_conv_moments, get_self_concolution_moments
6
6
 
7
7
  import rand_destribution as rd
8
8
 
@@ -40,7 +40,7 @@ class ServerWarmUp(Server):
40
40
  elif self.dist.type == 'Gamma':
41
41
  b = rd.Gamma.calc_theory_moments(*self.dist.params)
42
42
 
43
- f_summ = convolution_sum_calc.get_moments(b, self.delta)
43
+ f_summ = get_conv_moments.get_moments(b, self.delta)
44
44
  # variance = f_summ[1] - math.pow(f_summ[0], 2)
45
45
  # coev = math.sqrt(variance)/f_summ[0]
46
46
  params = rd.Gamma.get_mu_alpha(f_summ)
@@ -127,7 +127,7 @@ class ForkJoinSimDelta(ForkJoinSim):
127
127
  if not isinstance(self.delta, list):
128
128
  t.subtasks[i].future_arr_time = self.ttek + i * self.delta
129
129
  else:
130
- b_delta = convolution_sum_calc.get_self_concolution(self.delta, i)
130
+ b_delta = get_self_concolution_moments(self.delta, i)
131
131
  params_delta = rd.Gamma.get_mu_alpha(b_delta)
132
132
  t.subtasks[i].future_arr_time = self.ttek + rd.Gamma.generate_static(*params_delta)
133
133
  self.subtask_arr_queue.append(t.subtasks[i])
@@ -300,69 +300,3 @@ class ForkJoinSimDelta(ForkJoinSim):
300
300
  return res
301
301
 
302
302
 
303
- if __name__ == '__main__':
304
-
305
- from most_queue.theory import fj_calc
306
- from most_queue.theory import mg1_warm_calc
307
- from most_queue.utils.tables import times_print
308
-
309
- n = 3
310
- l = 1.0
311
- b1 = 0.35
312
- coev = 1.2
313
- b1_delta = 0.1
314
- b_params = rd.H2_dist.get_params_by_mean_and_coev(b1, coev)
315
-
316
- delta_params = rd.H2_dist.get_params_by_mean_and_coev(b1_delta, coev)
317
- b_delta = rd.H2_dist.calc_theory_moments(*delta_params)
318
- b = rd.H2_dist.calc_theory_moments(*b_params, 4)
319
-
320
- qs = ForkJoinSimDelta(n, n, b_delta, True)
321
- qs.set_sources(l, 'M')
322
- qs.set_servers(b_params, 'H')
323
- qs.run(100000)
324
- v_im = qs.v
325
-
326
- b_max_warm = fj_calc.getMaxMomentsDelta(n, b, 4, b_delta)
327
- b_max = fj_calc.getMaxMoments(n, b, 4)
328
- ro = l * b_max[0]
329
- v_ch = mg1_warm_calc.get_v(l, b_max, b_max_warm)
330
-
331
- print("\n")
332
- print("-" * 60)
333
- print("{:^60s}".format('СМО Split-Join c задержкой начала обслуживания'))
334
- print("-" * 60)
335
- print("Коэфф вариации времени обслуживания: ", coev)
336
- print("Среднее время задежки начала обслуживания: {:4.3f}".format(b1_delta))
337
- print("Коэфф вариации времени задержки: {:4.3f}".format(coev))
338
- print("Коэффициент загрузки: {:4.3f}".format(ro))
339
-
340
- times_print(v_im, v_ch, is_w=False)
341
-
342
- coev = 0.53
343
- b1 = 0.5
344
-
345
- b1_delta = 0.1
346
- delta_params = rd.Erlang_dist.get_params_by_mean_and_coev(b1_delta, coev)
347
- b_delta = rd.Erlang_dist.calc_theory_moments(*delta_params)
348
-
349
- b_params = rd.Erlang_dist.get_params_by_mean_and_coev(b1, coev)
350
- b = rd.Erlang_dist.calc_theory_moments(*b_params, 4)
351
-
352
- qs = ForkJoinSimDelta(n, n, b_delta, True)
353
- qs.set_sources(l, 'M')
354
- qs.set_servers(b_params, 'E')
355
- qs.run(100000)
356
- v_im = qs.v
357
-
358
- b_max_warm = fj_calc.getMaxMomentsDelta(n, b, 4, b_delta)
359
- b_max = fj_calc.getMaxMoments(n, b, 4)
360
- ro = l * b_max[0]
361
- v_ch = mg1_warm_calc.get_v(l, b_max, b_max_warm)
362
-
363
- print("\n\nКоэфф вариации времени обслуживания: ", coev)
364
- print("Коэффициент загрузки: {:4.3f}".format(ro))
365
- print("Среднее время задежки начала обслуживания: {:4.3f}".format(b1_delta))
366
- print("Коэфф вариации времени задержки: {:4.3f}".format(coev))
367
-
368
- times_print(v_im, v_ch, is_w=False)
@@ -277,53 +277,3 @@ class QueueingSystemException(Exception):
277
277
  def __str__(self, text):
278
278
  return text
279
279
 
280
-
281
- if __name__ == '__main__':
282
-
283
- from most_queue.theory import mg1_calc
284
- from most_queue.theory import fj_calc
285
- from most_queue.utils.tables import times_print
286
-
287
- n = 3
288
- l = 1.0
289
- b1 = 0.37
290
- coev = 1.5
291
- params = rd.H2_dist.get_params_by_mean_and_coev(b1, coev)
292
- b = rd.H2_dist.calc_theory_moments(*params, 4)
293
-
294
- qs = ForkJoinSim(n, n, True)
295
- qs.set_sources(l, 'M')
296
- qs.set_servers(params, 'H')
297
- qs.run(100000)
298
- v_im = qs.v
299
-
300
- b_max = fj_calc.getMaxMoments(n, b, 4)
301
- ro = l * b_max[0]
302
- v_ch = mg1_calc.get_v(l, b_max)
303
-
304
- print("\n")
305
- print("-" * 60)
306
- print("{:^60s}".format('СМО Split-Join'))
307
- print("-" * 60)
308
- print("Коэфф вариации времени обслуживания: ", coev)
309
- print("Коэффициент загрузки: {:4.3f}".format(ro))
310
- times_print(v_im, v_ch, is_w=False)
311
-
312
- coev = 0.8
313
- b1 = 0.5
314
- params = rd.Erlang_dist.get_params_by_mean_and_coev(b1, coev)
315
- b = rd.Erlang_dist.calc_theory_moments(*params, 4)
316
-
317
- qs = ForkJoinSim(n, n, True)
318
- qs.set_sources(l, 'M')
319
- qs.set_servers(params, 'E')
320
- qs.run(100000)
321
- v_im = qs.v
322
-
323
- b_max = fj_calc.getMaxMoments(n, b, 4)
324
- ro = l * b_max[0]
325
- v_ch = mg1_calc.get_v(l, b_max)
326
-
327
- print("\n\nКоэфф вариации времени обслуживания: ", coev)
328
- print("Коэффициент загрузки: {:4.3f}".format(ro))
329
- times_print(v_im, v_ch, is_w=False)
@@ -1,5 +1,5 @@
1
1
  import rand_destribution as rd
2
- from qs_sim import QueueingSystemSimulator, QueueSystemException, Task
2
+ from qs_sim import QueueingSystemSimulator, Task, SetSmoException
3
3
 
4
4
 
5
5
  class ImpatientTask(Task):
@@ -53,7 +53,7 @@ class ImpatientQueueSim(QueueingSystemSimulator):
53
53
  elif self.impatience_types == "D":
54
54
  self.impatience = rd.Det_dist(self.impatience_params)
55
55
  else:
56
- raise QueueSystemException(
56
+ raise SetSmoException(
57
57
  "Неправильно задан тип распределения нетерпения заявок. Варианты М, Н, Е, С, D, Pa, Uniform")
58
58
 
59
59
  def arrival(self):
@@ -163,30 +163,4 @@ class ImpatientQueueSim(QueueingSystemSimulator):
163
163
  print(f'Task {num_of_task_earlier} is earlier to leave at {moment_to_leave_earlier:8.3f}')
164
164
 
165
165
 
166
- if __name__ == '__main__':
167
- from most_queue.theory import impatience_calc
168
166
 
169
- n = 1
170
- l = 1.0
171
- ro = 0.8
172
- n_jobs = 300000
173
- mu = l / (ro * n)
174
- gamma = 0.2
175
-
176
- v1 = impatience_calc.get_v1(l, mu, gamma)
177
-
178
- qs = ImpatientQueueSim(n)
179
-
180
- qs.set_sources(l, 'M')
181
- qs.set_servers(mu, 'M')
182
- qs.set_impatiens(gamma, 'M')
183
-
184
- qs.run(n_jobs)
185
-
186
- v1_im = qs.v[0]
187
-
188
- print("\nЗначения среднего времени пребывания заявок в системе:\n")
189
-
190
- print("{0:^15s}|{1:^15s}|{2:^15s}".format("№ момента", "Числ", "ИМ"))
191
- print("-" * 45)
192
- print("{0:^16d}|{1:^15.5g}|{2:^15.5g}".format(1, v1, v1_im))
@@ -3,7 +3,7 @@ import rand_destribution as rd
3
3
  import numpy as np
4
4
  import math
5
5
  from priority_queue_sim import Task
6
- from most_queue.theory import network_calc
6
+ from theory import network_calc
7
7
  import time
8
8
  from tqdm import tqdm
9
9
  import sys
@@ -155,91 +155,3 @@ class PriorityNetwork:
155
155
  print(Style.RESET_ALL)
156
156
 
157
157
 
158
- if __name__ == '__main__':
159
-
160
- from most_queue.utils.tables import times_print_with_classes
161
-
162
- k_num = 3
163
- n_num = 5
164
- n = [3, 2, 3, 4, 3]
165
- R = []
166
- b = [] # k, node, j
167
- for i in range(k_num):
168
- R.append(np.matrix([
169
- [1, 0, 0, 0, 0, 0],
170
- [0, 0.4, 0.6, 0, 0, 0],
171
- [0, 0, 0, 0.6, 0.4, 0],
172
- [0, 0, 0, 0, 1, 0],
173
- [0, 0, 0, 0, 1, 0],
174
- [0, 0, 0, 0, 0, 1]
175
- ]))
176
- L = [0.1, 0.3, 0.4]
177
- nodes_prty = []
178
- jobs_num = 100000
179
- serv_params = []
180
- h2_params = []
181
- for m in range(n_num):
182
- nodes_prty.append([])
183
- for j in range(k_num):
184
- if m % 2 == 0:
185
- nodes_prty[m].append(j)
186
- else:
187
- nodes_prty[m].append(k_num - j - 1)
188
-
189
- b1 = 0.9 * n[m] / sum(L)
190
- coev = 1.2
191
- h2_params.append(rd.H2_dist.get_params_by_mean_and_coev(b1, coev))
192
-
193
- serv_params.append([])
194
- for i in range(k_num):
195
- serv_params[m].append({'type': 'H', 'params': h2_params[m]})
196
-
197
- for k in range(k_num):
198
- b.append([])
199
- for m in range(n_num):
200
- b[k].append(rd.H2_dist.calc_theory_moments(*h2_params[m], 4))
201
-
202
- prty = ['NP'] * n_num
203
- qn = PriorityNetwork(k_num, L, R, n, prty, serv_params, nodes_prty)
204
-
205
- qn.run(jobs_num)
206
-
207
- v_sim = qn.v_network
208
-
209
- calc_res = network_calc.network_prty_calc(R, b, n, L, prty, nodes_prty)
210
- v_ch = calc_res['v']
211
- loads = calc_res['loads']
212
-
213
- print("\n")
214
- print("-" * 60)
215
- print("{0:^60s}\n{1:^60s}".format("Сравнение данных ИМ и результатов расчета времени пребывания",
216
- "в СеМО с многоканальными узлами и приоритетами"))
217
- print("-" * 60)
218
- print("Количество каналов в узлах:")
219
- for nn in n:
220
- print("{0:^1d}".format(nn), end=" ")
221
- print("\nКоэффициенты загрузки узлов:")
222
- for load in loads:
223
- print("{0:^1.3f}".format(load), end=" ")
224
- print("\n")
225
- print("-" * 60)
226
- print("{0:^60s}".format("Относительный приоритет"))
227
-
228
- print("-" * 60)
229
- times_print_with_classes(v_sim, v_ch, is_w=False)
230
-
231
- prty = ['PR'] * n_num
232
- qn = PriorityNetwork(k_num, L, R, n, prty, serv_params, nodes_prty)
233
-
234
- qn.run(jobs_num)
235
-
236
- v_sim = qn.v_network
237
-
238
- calc_res = network_calc.network_prty_calc(R, b, n, L, prty, nodes_prty)
239
- v_ch = calc_res['v']
240
-
241
- print("-" * 60)
242
- print("{0:^60s}".format("Абсолютный приоритет"))
243
- print("-" * 60)
244
-
245
- times_print_with_classes(v_sim, v_ch, is_w=False)
@@ -1,4 +1,4 @@
1
- from most_queue.sim import rand_destribution as rd
1
+ from sim import rand_destribution as rd
2
2
 
3
3
  import time
4
4
  import sys
@@ -810,73 +810,4 @@ class Server:
810
810
  return res
811
811
 
812
812
 
813
- if __name__ == "__main__":
814
- from most_queue.theory import priority_calc
815
- import math
816
- import rand_destribution as rd
817
- from most_queue.utils.tables import times_print_with_classes
818
813
 
819
- n = 5
820
- k = 3
821
- l = [0.2, 0.3, 0.4]
822
- lsum = sum(l)
823
- num_of_jobs = 100000
824
- b1 = [0.45 * n, 0.9 * n, 1.35 * n]
825
- b2 = [0] * k
826
- coev = 0.577
827
-
828
- for i in range(k):
829
- b2[i] = (b1[i] ** 2) * (1 + coev ** 2)
830
- b_sr = sum(b1) / k
831
- ro = lsum * b_sr / n
832
- params = []
833
- for i in range(k):
834
- params.append(rd.Gamma.get_mu_alpha([b1[i], b2[i]]))
835
-
836
- b = []
837
- for j in range(k):
838
- b.append(rd.Gamma.calc_theory_moments(params[j][0], params[j][1], 4))
839
-
840
- print("\nСравнение данных ИМ и результатов расчета методом инвариантов отношения (Р) \n"
841
- "времени пребывания в многоканальной СМО с приоритетами")
842
- print("Число каналов: " + str(n) + "\nЧисло классов: " + str(k) + "\nКоэффициент загрузки: {0:<1.2f}".format(ro) +
843
- "\nКоэффициент вариации времени обслуживания: " + str(coev) + "\n")
844
- print("Абсолютный приоритет")
845
-
846
- qs = PriorityQueueSimulator(n, k, "PR")
847
- sources = []
848
- servers_params = []
849
- for j in range(k):
850
- sources.append({'type': 'M', 'params': l[j]})
851
- servers_params.append({'type': 'Gamma', 'params': params[j]})
852
-
853
- qs.set_sources(sources)
854
- qs.set_servers(servers_params)
855
-
856
- qs.run(num_of_jobs)
857
-
858
- v_im = qs.v
859
-
860
- v_teor = priority_calc.get_v_prty_invar(l, b, n, 'PR')
861
-
862
- times_print_with_classes(v_im, v_teor, is_w=False)
863
-
864
- print("Относительный приоритет")
865
-
866
- qs = PriorityQueueSimulator(n, k, "NP")
867
- sources = []
868
- servers_params = []
869
- for j in range(k):
870
- sources.append({'type': 'M', 'params': l[j]})
871
- servers_params.append({'type': 'Gamma', 'params': params[j]})
872
-
873
- qs.set_sources(sources)
874
- qs.set_servers(servers_params)
875
-
876
- qs.run(num_of_jobs)
877
-
878
- v_im = qs.v
879
-
880
- v_teor = priority_calc.get_v_prty_invar(l, b, n, 'NP')
881
-
882
- times_print_with_classes(v_im, v_teor, is_w=False)