most-queue 2.2__py3-none-any.whl → 2.4__py3-none-any.whl
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.
- most_queue/{distr_utils → io}/__init__.py +0 -0
- most_queue/misc/approx_cdf_make.py +1 -1
- most_queue/misc/calc_v_pls.py +1 -1
- most_queue/misc/flow_sum.py +1 -1
- most_queue/misc/run_mgn_with_h2_delay_cold_warm.py +1 -1
- most_queue/misc/{test_fj_delta.py → tests/test_fj_delta.py} +2 -2
- most_queue/misc/{test_network_opt_approx.py → tests/test_network_opt_approx.py} +1 -1
- most_queue/misc/{test_network_opt_plus.py → tests/test_network_opt_plus.py} +1 -1
- most_queue/misc/vacations_paper_utils.py +1 -1
- most_queue/{general → random}/__init__.py +0 -0
- most_queue/{distributions.py → random/distributions.py} +45 -3
- most_queue/{sim/utils → random}/distributions.yaml +7 -4
- most_queue/random/utils/create.py +71 -0
- most_queue/{distr_utils/distribution_fitting.py → random/utils/fit.py} +1 -1
- most_queue/random/utils/load.py +100 -0
- most_queue/sim/base.py +4 -4
- most_queue/sim/finite_source.py +1 -1
- most_queue/sim/flow_sum.py +1 -1
- most_queue/sim/fork_join_delta.py +1 -1
- most_queue/sim/impatient.py +1 -1
- most_queue/sim/negative.py +3 -2
- most_queue/sim/networks/base_network_sim.py +1 -1
- most_queue/sim/networks/network.py +1 -1
- most_queue/sim/networks/priority_network.py +1 -1
- most_queue/sim/priority.py +2 -2
- most_queue/sim/utils/servers.py +2 -2
- most_queue/sim/vacations.py +3 -4
- most_queue/theory/batch/mm1.py +1 -1
- most_queue/theory/closed/engset.py +1 -1
- most_queue/theory/fifo/ek_d_n.py +2 -2
- most_queue/theory/fifo/gi_m_1.py +2 -2
- most_queue/theory/fifo/gi_m_n.py +2 -2
- most_queue/theory/fifo/m_d_n.py +1 -1
- most_queue/theory/fifo/mg1.py +2 -2
- most_queue/theory/fifo/mgn_takahasi.py +2 -2
- most_queue/theory/fifo/mmnr.py +2 -2
- most_queue/theory/fork_join/m_m_n.py +1 -1
- most_queue/theory/fork_join/split_join.py +1 -1
- most_queue/theory/impatience/mm1.py +1 -1
- most_queue/theory/negative/mg1_disasters.py +2 -2
- most_queue/theory/negative/mg1_rcs.py +2 -2
- most_queue/theory/negative/mgn_disaster.py +2 -2
- most_queue/theory/negative/mgn_rcs.py +2 -2
- most_queue/theory/networks/base_network_calc.py +1 -1
- most_queue/theory/networks/open_network.py +1 -1
- most_queue/theory/networks/open_network_prty.py +1 -1
- most_queue/theory/priority/mgn_invar_approx.py +1 -1
- most_queue/theory/priority/non_preemptive/mg1.py +2 -2
- most_queue/theory/priority/preemptive/m_ph_n_busy_approx.py +2 -2
- most_queue/theory/priority/preemptive/mg1.py +1 -1
- most_queue/theory/priority/preemptive/mm2_3cls_busy_approx.py +2 -2
- most_queue/theory/priority/preemptive/mmn_2cls_pr_busy_approx.py +2 -2
- most_queue/theory/utils/busy_periods.py +1 -1
- most_queue/theory/utils/conditional.py +2 -2
- most_queue/theory/utils/flow_sum.py +1 -1
- most_queue/theory/utils/max_dist.py +1 -1
- most_queue/theory/utils/q_poisson_arrival_calc.py +1 -1
- most_queue/theory/utils/transforms.py +1 -1
- most_queue/theory/vacations/m_h2_h2warm.py +2 -2
- most_queue/theory/vacations/mg1_warm_calc.py +2 -2
- most_queue/theory/vacations/mgn_with_h2_delay_cold_warm.py +2 -2
- most_queue/theory/vacations/mmn_with_h2_cold_and_h2_warmup.py +2 -2
- {most_queue-2.2.dist-info → most_queue-2.4.dist-info}/METADATA +5 -31
- most_queue-2.4.dist-info/RECORD +110 -0
- most_queue/sim/utils/distribution_utils.py +0 -222
- most_queue/sim/utils/exceptions.py +0 -37
- most_queue-2.2.dist-info/RECORD +0 -110
- /most_queue/{general → io}/plots.py +0 -0
- /most_queue/{general → io}/tables.py +0 -0
- /most_queue/{distr_utils/base_distribution.py → random/utils/base.py} +0 -0
- /most_queue/{distr_utils/distribution_params.py → random/utils/params.py} +0 -0
- /most_queue/{general/results_structs.py → structs.py} +0 -0
- {most_queue-2.2.dist-info → most_queue-2.4.dist-info}/WHEEL +0 -0
- {most_queue-2.2.dist-info → most_queue-2.4.dist-info}/licenses/LICENSE +0 -0
|
File without changes
|
most_queue/misc/calc_v_pls.py
CHANGED
|
@@ -9,7 +9,7 @@ from functools import lru_cache
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
from scipy.misc import derivative
|
|
11
11
|
|
|
12
|
-
from most_queue.distributions import H2Distribution, H2Params
|
|
12
|
+
from most_queue.random.distributions import H2Distribution, H2Params
|
|
13
13
|
from most_queue.theory.fifo.mgn_takahasi import MGnCalc, TakahashiTakamiParams
|
|
14
14
|
from most_queue.theory.utils.conv import conv_moments
|
|
15
15
|
from most_queue.theory.utils.transforms import lst_exp
|
most_queue/misc/flow_sum.py
CHANGED
|
@@ -5,7 +5,7 @@ Test summation of flows.
|
|
|
5
5
|
|
|
6
6
|
import matplotlib.pyplot as plt
|
|
7
7
|
|
|
8
|
-
from most_queue.distributions import GammaDistribution
|
|
8
|
+
from most_queue.random.distributions import GammaDistribution
|
|
9
9
|
from most_queue.sim.flow_sum import FlowSumSim
|
|
10
10
|
from most_queue.theory.utils.flow_sum import SummatorNumeric
|
|
11
11
|
|
|
@@ -8,7 +8,6 @@ import time
|
|
|
8
8
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
|
|
11
|
-
from most_queue.distributions import GammaDistribution
|
|
12
11
|
from most_queue.misc.vacations_paper_utils import (
|
|
13
12
|
calc_moments_by_mean_and_cv,
|
|
14
13
|
dump_stat,
|
|
@@ -16,6 +15,7 @@ from most_queue.misc.vacations_paper_utils import (
|
|
|
16
15
|
make_plot,
|
|
17
16
|
print_table,
|
|
18
17
|
)
|
|
18
|
+
from most_queue.random.distributions import GammaDistribution
|
|
19
19
|
from most_queue.sim.vacations import VacationQueueingSystemSimulator
|
|
20
20
|
from most_queue.theory.vacations.mgn_with_h2_delay_cold_warm import (
|
|
21
21
|
MGnH2ServingColdWarmDelay,
|
|
@@ -7,8 +7,8 @@ import os
|
|
|
7
7
|
import numpy as np
|
|
8
8
|
import yaml
|
|
9
9
|
|
|
10
|
-
from most_queue.
|
|
11
|
-
from most_queue.
|
|
10
|
+
from most_queue.io.tables import times_print
|
|
11
|
+
from most_queue.random.distributions import GammaDistribution
|
|
12
12
|
from most_queue.sim.fork_join_delta import ForkJoinSimDelta
|
|
13
13
|
from most_queue.theory.fork_join.split_join import SplitJoinCalc
|
|
14
14
|
|
|
@@ -4,7 +4,7 @@ Test the NetworkOptimizerWithApprox class.
|
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
7
|
-
from most_queue.distributions import ExpDistribution
|
|
7
|
+
from most_queue.random.distributions import ExpDistribution
|
|
8
8
|
from most_queue.theory.networks.open_network import OpenNetworkCalc
|
|
9
9
|
from most_queue.theory.networks.opt.transition_approx import NetworkOptimizerWithApprox
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ Test the NetworkOptimizerPlus class.
|
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
7
|
-
from most_queue.distributions import ExpDistribution
|
|
7
|
+
from most_queue.random.distributions import ExpDistribution
|
|
8
8
|
from most_queue.theory.networks.open_network import OpenNetworkCalc
|
|
9
9
|
from most_queue.theory.networks.opt.transition_plus import NetworkOptimizerPlus, Strategy
|
|
10
10
|
|
|
File without changes
|
|
@@ -4,13 +4,16 @@ Random distributions for simulation.
|
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
import math
|
|
7
|
+
import os
|
|
7
8
|
|
|
8
9
|
import numpy as np
|
|
9
10
|
import scipy.special as sp
|
|
11
|
+
import yaml
|
|
12
|
+
from colorama import Fore, Style
|
|
10
13
|
from scipy import stats
|
|
11
14
|
|
|
12
|
-
from most_queue.
|
|
13
|
-
from most_queue.
|
|
15
|
+
from most_queue.random.utils.base import Distribution
|
|
16
|
+
from most_queue.random.utils.fit import (
|
|
14
17
|
FittingParams,
|
|
15
18
|
calc_gamma_func,
|
|
16
19
|
fit_cox,
|
|
@@ -23,7 +26,7 @@ from most_queue.distr_utils.distribution_fitting import (
|
|
|
23
26
|
fit_weibull,
|
|
24
27
|
gamma_moments_by_mean_and_cv,
|
|
25
28
|
)
|
|
26
|
-
from most_queue.
|
|
29
|
+
from most_queue.random.utils.params import (
|
|
27
30
|
Cox2Params,
|
|
28
31
|
ErlangParams,
|
|
29
32
|
GammaParams,
|
|
@@ -35,6 +38,41 @@ from most_queue.distr_utils.distribution_params import (
|
|
|
35
38
|
)
|
|
36
39
|
|
|
37
40
|
|
|
41
|
+
def print_supported_distributions():
|
|
42
|
+
"""Prints supported distributions loaded from a YAML file."""
|
|
43
|
+
print(f"{Fore.GREEN}Supported distributions:{Style.RESET_ALL}")
|
|
44
|
+
separator = f"{Fore.BLUE}{'-' * 80}{Style.RESET_ALL}"
|
|
45
|
+
|
|
46
|
+
dist_path = os.path.join(os.path.dirname(__file__), "distributions.yaml")
|
|
47
|
+
try:
|
|
48
|
+
with open(dist_path, "r", encoding="utf-8") as file:
|
|
49
|
+
distributions = yaml.safe_load(file)
|
|
50
|
+
except FileNotFoundError:
|
|
51
|
+
print(f"{Fore.RED}Error: distributions.yaml not found.{Style.RESET_ALL}")
|
|
52
|
+
return
|
|
53
|
+
except yaml.YAMLError as e:
|
|
54
|
+
print(f"{Fore.RED}Error parsing distributions.yaml: {e}{Style.RESET_ALL}")
|
|
55
|
+
return
|
|
56
|
+
|
|
57
|
+
header = (
|
|
58
|
+
f"{separator}\n"
|
|
59
|
+
f"{Fore.CYAN}Distribution{'-':20}"
|
|
60
|
+
f"{Fore.GREEN}Kendall notation{'-':15}"
|
|
61
|
+
f"{Fore.RED}Parameters{Style.RESET_ALL}\n"
|
|
62
|
+
f"{separator}"
|
|
63
|
+
)
|
|
64
|
+
print(header)
|
|
65
|
+
|
|
66
|
+
for dist in distributions:
|
|
67
|
+
name = dist.get("name", "N/A")
|
|
68
|
+
kendall = dist.get("kendall_notation", "N/A")
|
|
69
|
+
params = dist.get("params", "N/A")
|
|
70
|
+
print(f"{Fore.MAGENTA}{name:<38}" f"{Fore.GREEN}{kendall:<19}" f"{Fore.RED}{params}{Style.RESET_ALL}")
|
|
71
|
+
print(separator)
|
|
72
|
+
|
|
73
|
+
print(f"{Fore.BLUE}See params dataclasses in most_queue.random.utils.params {Style.RESET_ALL}")
|
|
74
|
+
|
|
75
|
+
|
|
38
76
|
class Weibull(Distribution):
|
|
39
77
|
"""
|
|
40
78
|
Class for working with the Weibull distribution
|
|
@@ -1022,3 +1060,7 @@ class GammaDistribution(Distribution):
|
|
|
1022
1060
|
gamma = sp.gamma(x)
|
|
1023
1061
|
fraction = -math.pi / (x * math.sin(math.pi * x))
|
|
1024
1062
|
return fraction / gamma
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
if __name__ == "__main__":
|
|
1066
|
+
print_supported_distributions()
|
|
@@ -6,19 +6,22 @@
|
|
|
6
6
|
params: H2Params dataclass
|
|
7
7
|
- name: Erlang
|
|
8
8
|
kendall_notation: E
|
|
9
|
-
params:
|
|
9
|
+
params: ErlangParams dataclass
|
|
10
10
|
- name: Cox 2nd order
|
|
11
11
|
kendall_notation: C
|
|
12
12
|
params: Cox2Params dataclass
|
|
13
13
|
- name: Pareto
|
|
14
14
|
kendall_notation: Pa
|
|
15
|
-
params:
|
|
15
|
+
params: ParetoParams dataclass
|
|
16
|
+
- name: Gamma
|
|
17
|
+
kendall_notation: G
|
|
18
|
+
params: GammaParams dataclass
|
|
16
19
|
- name: Deterministic
|
|
17
20
|
kendall_notation: D
|
|
18
21
|
params: b
|
|
19
22
|
- name: Uniform
|
|
20
23
|
kendall_notation: Uniform
|
|
21
|
-
params:
|
|
24
|
+
params: UniformParams dataclass
|
|
22
25
|
- name: Gaussian
|
|
23
26
|
kendall_notation: Norm
|
|
24
|
-
params:
|
|
27
|
+
params: GaussianParams dataclass
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Utils for distribution from random_distributions
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from most_queue.random.distributions import (
|
|
7
|
+
CoxDistribution,
|
|
8
|
+
DeterministicDistribution,
|
|
9
|
+
ErlangDistribution,
|
|
10
|
+
ExpDistribution,
|
|
11
|
+
GammaDistribution,
|
|
12
|
+
H2Distribution,
|
|
13
|
+
NormalDistribution,
|
|
14
|
+
ParetoDistribution,
|
|
15
|
+
UniformDistribution,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def create_distribution(params, kendall_notation: str, generator):
|
|
20
|
+
"""Creates distribution from random_distributions
|
|
21
|
+
|
|
22
|
+
--------------------------------------------------------------------
|
|
23
|
+
Distribution kendall_notation params
|
|
24
|
+
--------------------------------------------------------------------
|
|
25
|
+
Exponential 'М' [mu]
|
|
26
|
+
Hyperexponential of the 2nd order 'Н' H2Params dataclass
|
|
27
|
+
Erlang 'E' [r, mu]
|
|
28
|
+
Cox 2nd order 'C' Cox2Params dataclass
|
|
29
|
+
Pareto 'Pa' [alpha, K]
|
|
30
|
+
Deterministic 'D' [b]
|
|
31
|
+
Uniform 'Uniform' [mean, half_interval]
|
|
32
|
+
Gaussian 'Norm' [mean, standard_deviation]
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
params (_type_): params of distribution.
|
|
36
|
+
For "M": one single value "mu".
|
|
37
|
+
For "H": H2Params
|
|
38
|
+
kendall_notation (str): like "M", "H", "E"
|
|
39
|
+
generator (_type_): random numbers generator, for ex np.random.default_rng()
|
|
40
|
+
|
|
41
|
+
Raises:
|
|
42
|
+
QsSourseSettingException: Incorrect distribution type specified
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
_type_: distribution from random_distributions
|
|
46
|
+
"""
|
|
47
|
+
dist = None
|
|
48
|
+
if kendall_notation == "M":
|
|
49
|
+
dist = ExpDistribution(params, generator=generator)
|
|
50
|
+
elif kendall_notation == "H":
|
|
51
|
+
dist = H2Distribution(params, generator=generator)
|
|
52
|
+
elif kendall_notation == "E":
|
|
53
|
+
dist = ErlangDistribution(params, generator=generator)
|
|
54
|
+
elif kendall_notation == "Gamma":
|
|
55
|
+
dist = GammaDistribution(params, generator=generator)
|
|
56
|
+
elif kendall_notation == "C":
|
|
57
|
+
dist = CoxDistribution(params, generator=generator)
|
|
58
|
+
elif kendall_notation == "Pa":
|
|
59
|
+
dist = ParetoDistribution(params, generator=generator)
|
|
60
|
+
elif kendall_notation == "Uniform":
|
|
61
|
+
dist = UniformDistribution(params, generator=generator)
|
|
62
|
+
elif kendall_notation == "Norm":
|
|
63
|
+
dist = NormalDistribution(params, generator=generator)
|
|
64
|
+
elif kendall_notation == "D":
|
|
65
|
+
dist = DeterministicDistribution(params)
|
|
66
|
+
else:
|
|
67
|
+
raise ValueError(
|
|
68
|
+
"Incorrect distribution type specified. See most_queue.random.distributions.print_supported_distributions() for list of supported distributions"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
return dist
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Calculates the utilization (load factor) of the QS
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def calc_qs_load(source_kendall_notation: str, source_params, server_kendall_notation: str, server_params, n) -> float:
|
|
7
|
+
"""Calculates the utilization (load factor) of the QS
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
source_kendall_notation: str, Kendall notation of source
|
|
11
|
+
server_kendall_notation: str, Kendall notation of source
|
|
12
|
+
n (int): number of QS channels
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
float: utilization (load factor) of the QS
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
l = 0
|
|
19
|
+
if source_kendall_notation == "M":
|
|
20
|
+
l = source_params
|
|
21
|
+
elif source_kendall_notation == "D":
|
|
22
|
+
l = 1.00 / source_params
|
|
23
|
+
elif source_kendall_notation == "Uniform":
|
|
24
|
+
l = 1.00 / source_params.mean
|
|
25
|
+
elif source_kendall_notation == "H":
|
|
26
|
+
y1 = source_params.p1
|
|
27
|
+
y2 = 1.0 - y1
|
|
28
|
+
mu1 = source_params.mu1
|
|
29
|
+
mu2 = source_params.mu2
|
|
30
|
+
|
|
31
|
+
f1 = y1 / mu1 + y2 / mu2
|
|
32
|
+
l = 1.0 / f1
|
|
33
|
+
|
|
34
|
+
elif source_kendall_notation == "E":
|
|
35
|
+
r = source_params.r
|
|
36
|
+
mu = source_params.mu
|
|
37
|
+
l = mu / r
|
|
38
|
+
|
|
39
|
+
elif source_kendall_notation == "Gamma":
|
|
40
|
+
mu = source_params.mu
|
|
41
|
+
alpha = source_params.alpha
|
|
42
|
+
l = mu / alpha
|
|
43
|
+
|
|
44
|
+
elif source_kendall_notation == "C":
|
|
45
|
+
y1 = source_params.p1
|
|
46
|
+
y2 = 1.0 - y1
|
|
47
|
+
mu1 = source_params.mu1
|
|
48
|
+
mu2 = source_params.mu2
|
|
49
|
+
|
|
50
|
+
f1 = y2 / mu1 + y1 * (1.0 / mu1 + 1.0 / mu2)
|
|
51
|
+
l = 1.0 / f1
|
|
52
|
+
elif source_kendall_notation == "Pa":
|
|
53
|
+
if source_params[0] < 1:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
a = source_params.alpha
|
|
57
|
+
k = source_params.K
|
|
58
|
+
f1 = a * k / (a - 1)
|
|
59
|
+
l = 1.0 / f1
|
|
60
|
+
|
|
61
|
+
b1 = 0
|
|
62
|
+
if server_kendall_notation == "M":
|
|
63
|
+
mu = server_params
|
|
64
|
+
b1 = 1.0 / mu
|
|
65
|
+
elif server_kendall_notation == "D":
|
|
66
|
+
b1 = server_params
|
|
67
|
+
elif server_kendall_notation == "Uniform":
|
|
68
|
+
b1 = server_params.mean
|
|
69
|
+
|
|
70
|
+
elif server_kendall_notation == "H":
|
|
71
|
+
y1 = server_params.p1
|
|
72
|
+
y2 = 1.0 - y1
|
|
73
|
+
mu1 = server_params.mu1
|
|
74
|
+
mu2 = server_params.mu2
|
|
75
|
+
|
|
76
|
+
b1 = y1 / mu1 + y2 / mu2
|
|
77
|
+
|
|
78
|
+
elif server_kendall_notation == "Gamma":
|
|
79
|
+
mu = server_params.mu
|
|
80
|
+
alpha = server_params.alpha
|
|
81
|
+
b1 = alpha / mu
|
|
82
|
+
|
|
83
|
+
elif server_kendall_notation == "E":
|
|
84
|
+
r = server_params.r
|
|
85
|
+
mu = server_params.mu
|
|
86
|
+
b1 = r / mu
|
|
87
|
+
|
|
88
|
+
elif server_kendall_notation == "C":
|
|
89
|
+
y1 = server_params.p1
|
|
90
|
+
y2 = 1.0 - y1
|
|
91
|
+
mu1 = server_params.mu1
|
|
92
|
+
mu2 = server_params.mu2
|
|
93
|
+
|
|
94
|
+
b1 = y2 / mu1 + y1 * (1.0 / mu1 + 1.0 / mu2)
|
|
95
|
+
elif server_kendall_notation == "Pa":
|
|
96
|
+
a = server_params.alpha
|
|
97
|
+
k = server_params.K
|
|
98
|
+
b1 = a * k / (a - 1)
|
|
99
|
+
|
|
100
|
+
return l * b1 / n
|
most_queue/sim/base.py
CHANGED
|
@@ -8,13 +8,13 @@ import numpy as np
|
|
|
8
8
|
from colorama import Fore, Style, init
|
|
9
9
|
from tqdm import tqdm
|
|
10
10
|
|
|
11
|
-
from most_queue.
|
|
12
|
-
from most_queue.
|
|
13
|
-
from most_queue.sim.utils.exceptions import QsWrongQueueTypeException
|
|
11
|
+
from most_queue.random.utils.create import create_distribution
|
|
12
|
+
from most_queue.random.utils.load import calc_qs_load
|
|
14
13
|
from most_queue.sim.utils.qs_queue import QsQueueDeque, QsQueueList
|
|
15
14
|
from most_queue.sim.utils.servers import Server
|
|
16
15
|
from most_queue.sim.utils.stats_update import refresh_moments_stat
|
|
17
16
|
from most_queue.sim.utils.tasks import Task
|
|
17
|
+
from most_queue.structs import QueueResults
|
|
18
18
|
|
|
19
19
|
init()
|
|
20
20
|
|
|
@@ -69,7 +69,7 @@ class QsSim:
|
|
|
69
69
|
elif buffer_type == "deque":
|
|
70
70
|
self.queue = QsQueueDeque()
|
|
71
71
|
else:
|
|
72
|
-
raise
|
|
72
|
+
raise ValueError("Unknown queue type")
|
|
73
73
|
|
|
74
74
|
self.servers = [] # service channels, list of Server's
|
|
75
75
|
|
most_queue/sim/finite_source.py
CHANGED
|
@@ -5,8 +5,8 @@ Simulating a queueing system with finite number of sources.
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
from colorama import Fore, Style, init
|
|
7
7
|
|
|
8
|
+
from most_queue.random.utils.create import create_distribution
|
|
8
9
|
from most_queue.sim.base import QsSim, Task
|
|
9
|
-
from most_queue.sim.utils.distribution_utils import create_distribution
|
|
10
10
|
|
|
11
11
|
init()
|
|
12
12
|
|
most_queue/sim/flow_sum.py
CHANGED
|
@@ -4,7 +4,7 @@ ForkJoin Queue with delta
|
|
|
4
4
|
|
|
5
5
|
from colorama import Fore, Style, init
|
|
6
6
|
|
|
7
|
-
from most_queue.distributions import GammaDistribution
|
|
7
|
+
from most_queue.random.distributions import GammaDistribution
|
|
8
8
|
from most_queue.sim.fork_join import ForkJoinSim
|
|
9
9
|
from most_queue.sim.utils.tasks import ForkJoinTask
|
|
10
10
|
from most_queue.theory.utils.conv import get_self_conv_moments
|
most_queue/sim/impatient.py
CHANGED
|
@@ -4,8 +4,8 @@ Simulation model for queueing systems with impatient tasks
|
|
|
4
4
|
|
|
5
5
|
from colorama import Fore, Style, init
|
|
6
6
|
|
|
7
|
+
from most_queue.random.utils.create import create_distribution
|
|
7
8
|
from most_queue.sim.base import QsSim
|
|
8
|
-
from most_queue.sim.utils.distribution_utils import create_distribution
|
|
9
9
|
from most_queue.sim.utils.tasks import ImpatientTask
|
|
10
10
|
|
|
11
11
|
init()
|
most_queue/sim/negative.py
CHANGED
|
@@ -7,10 +7,11 @@ from enum import Enum
|
|
|
7
7
|
|
|
8
8
|
import numpy as np
|
|
9
9
|
|
|
10
|
-
from most_queue.
|
|
10
|
+
from most_queue.random.utils.create import create_distribution
|
|
11
|
+
from most_queue.random.utils.load import calc_qs_load
|
|
11
12
|
from most_queue.sim.base import QsSim
|
|
12
|
-
from most_queue.sim.utils.distribution_utils import calc_qs_load, create_distribution
|
|
13
13
|
from most_queue.sim.utils.stats_update import refresh_moments_stat
|
|
14
|
+
from most_queue.structs import NegativeArrivalsResults
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class NegativeServiceType(Enum):
|
|
@@ -4,7 +4,7 @@ Base class for queueing networks simulation
|
|
|
4
4
|
|
|
5
5
|
from abc import ABC, abstractmethod
|
|
6
6
|
|
|
7
|
-
from most_queue.
|
|
7
|
+
from most_queue.structs import NetworkResults, NetworkResultsPriority
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class BaseSimNetwork(ABC):
|
|
@@ -9,7 +9,7 @@ import numpy as np
|
|
|
9
9
|
from colorama import Fore, init
|
|
10
10
|
from tqdm import tqdm
|
|
11
11
|
|
|
12
|
-
from most_queue.distributions import ExpDistribution
|
|
12
|
+
from most_queue.random.distributions import ExpDistribution
|
|
13
13
|
from most_queue.sim.base import QsSim
|
|
14
14
|
from most_queue.sim.networks.base_network_sim import BaseSimNetwork, NetworkResults
|
|
15
15
|
from most_queue.sim.utils.tasks import Task
|
|
@@ -9,7 +9,7 @@ import numpy as np
|
|
|
9
9
|
from colorama import Fore, init
|
|
10
10
|
from tqdm import tqdm
|
|
11
11
|
|
|
12
|
-
from most_queue.distributions import ExpDistribution
|
|
12
|
+
from most_queue.random.distributions import ExpDistribution
|
|
13
13
|
from most_queue.sim.networks.base_network_sim import (
|
|
14
14
|
BaseSimNetworkPriority,
|
|
15
15
|
NetworkResultsPriority,
|
most_queue/sim/priority.py
CHANGED
|
@@ -9,10 +9,10 @@ import numpy as np
|
|
|
9
9
|
from colorama import Fore, Style, init
|
|
10
10
|
from tqdm import tqdm
|
|
11
11
|
|
|
12
|
-
from most_queue.
|
|
13
|
-
from most_queue.sim.utils.distribution_utils import create_distribution
|
|
12
|
+
from most_queue.random.utils.create import create_distribution
|
|
14
13
|
from most_queue.sim.utils.servers import ServerPriority
|
|
15
14
|
from most_queue.sim.utils.tasks import TaskPriority
|
|
15
|
+
from most_queue.structs import PriorityResults
|
|
16
16
|
|
|
17
17
|
init()
|
|
18
18
|
|
most_queue/sim/utils/servers.py
CHANGED
|
@@ -4,7 +4,7 @@ QS channels or servers
|
|
|
4
4
|
|
|
5
5
|
from colorama import Fore, Style
|
|
6
6
|
|
|
7
|
-
from most_queue.distributions import (
|
|
7
|
+
from most_queue.random.distributions import (
|
|
8
8
|
CoxDistribution,
|
|
9
9
|
ErlangDistribution,
|
|
10
10
|
ExpDistribution,
|
|
@@ -13,7 +13,7 @@ from most_queue.distributions import (
|
|
|
13
13
|
NormalDistribution,
|
|
14
14
|
ParetoDistribution,
|
|
15
15
|
)
|
|
16
|
-
from most_queue.
|
|
16
|
+
from most_queue.random.utils.create import create_distribution
|
|
17
17
|
from most_queue.sim.utils.phase import QsPhase
|
|
18
18
|
from most_queue.sim.utils.tasks import Task
|
|
19
19
|
from most_queue.theory.utils.conv import conv_moments
|
most_queue/sim/vacations.py
CHANGED
|
@@ -4,12 +4,11 @@ Simulation model of QS GI/G/n/r and GI/G/n
|
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
7
|
-
from most_queue.
|
|
7
|
+
from most_queue.random.utils.create import create_distribution
|
|
8
8
|
from most_queue.sim.base import QsSim
|
|
9
|
-
from most_queue.sim.utils.distribution_utils import create_distribution
|
|
10
|
-
from most_queue.sim.utils.exceptions import QsSourseSettingException
|
|
11
9
|
from most_queue.sim.utils.phase import QsPhase
|
|
12
10
|
from most_queue.sim.utils.servers import Server
|
|
11
|
+
from most_queue.structs import VacationResults
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
class VacationQueueingSystemSimulator(QsSim):
|
|
@@ -88,7 +87,7 @@ class VacationQueueingSystemSimulator(QsSim):
|
|
|
88
87
|
"""
|
|
89
88
|
|
|
90
89
|
if not self.cold_phase.is_set:
|
|
91
|
-
raise
|
|
90
|
+
raise ValueError("You must first set the cooling time. Use the set_cold() method.")
|
|
92
91
|
|
|
93
92
|
dist = create_distribution(params, kendall_notation, self.generator)
|
|
94
93
|
self.cold_delay_phase.set_dist(dist)
|
most_queue/theory/batch/mm1.py
CHANGED
|
@@ -4,7 +4,7 @@ Calculation of M/M/1 QS with batch arrival
|
|
|
4
4
|
|
|
5
5
|
import time
|
|
6
6
|
|
|
7
|
-
from most_queue.
|
|
7
|
+
from most_queue.structs import QueueResults
|
|
8
8
|
from most_queue.theory.base_queue import BaseQueue
|
|
9
9
|
from most_queue.theory.calc_params import CalcParams
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ Calculation of the Engset model for M/M/1 with a finite number of sources.
|
|
|
4
4
|
|
|
5
5
|
import time
|
|
6
6
|
|
|
7
|
-
from most_queue.
|
|
7
|
+
from most_queue.structs import QueueResults
|
|
8
8
|
from most_queue.theory.base_queue import BaseQueue
|
|
9
9
|
from most_queue.theory.utils.conv import conv_moments
|
|
10
10
|
from most_queue.theory.utils.diff5dots import diff5dots
|
most_queue/theory/fifo/ek_d_n.py
CHANGED
|
@@ -8,8 +8,8 @@ import time
|
|
|
8
8
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
|
|
11
|
-
from most_queue.distributions import ErlangParams
|
|
12
|
-
from most_queue.
|
|
11
|
+
from most_queue.random.distributions import ErlangParams
|
|
12
|
+
from most_queue.structs import QueueResults
|
|
13
13
|
from most_queue.theory.base_queue import BaseQueue
|
|
14
14
|
from most_queue.theory.calc_params import CalcParams
|
|
15
15
|
|
most_queue/theory/fifo/gi_m_1.py
CHANGED
|
@@ -5,8 +5,8 @@ Calculation of the GI/M/1 queueing system
|
|
|
5
5
|
import math
|
|
6
6
|
import time
|
|
7
7
|
|
|
8
|
-
from most_queue.distributions import GammaDistribution, ParetoDistribution
|
|
9
|
-
from most_queue.
|
|
8
|
+
from most_queue.random.distributions import GammaDistribution, ParetoDistribution
|
|
9
|
+
from most_queue.structs import QueueResults
|
|
10
10
|
from most_queue.theory.base_queue import BaseQueue
|
|
11
11
|
from most_queue.theory.calc_params import CalcParams
|
|
12
12
|
from most_queue.theory.utils.conv import conv_moments_minus
|
most_queue/theory/fifo/gi_m_n.py
CHANGED
|
@@ -7,8 +7,8 @@ import time
|
|
|
7
7
|
|
|
8
8
|
import numpy as np
|
|
9
9
|
|
|
10
|
-
from most_queue.distributions import GammaDistribution, ParetoDistribution
|
|
11
|
-
from most_queue.
|
|
10
|
+
from most_queue.random.distributions import GammaDistribution, ParetoDistribution
|
|
11
|
+
from most_queue.structs import QueueResults
|
|
12
12
|
from most_queue.theory.base_queue import BaseQueue
|
|
13
13
|
from most_queue.theory.calc_params import CalcParams
|
|
14
14
|
from most_queue.theory.utils.conv import conv_moments
|
most_queue/theory/fifo/m_d_n.py
CHANGED
most_queue/theory/fifo/mg1.py
CHANGED
|
@@ -5,8 +5,8 @@ Calculation of M/G/1 queue characteristics using the method of moments.
|
|
|
5
5
|
import math
|
|
6
6
|
import time
|
|
7
7
|
|
|
8
|
-
from most_queue.distributions import GammaDistribution, ParetoDistribution, UniformDistribution
|
|
9
|
-
from most_queue.
|
|
8
|
+
from most_queue.random.distributions import GammaDistribution, ParetoDistribution, UniformDistribution
|
|
9
|
+
from most_queue.structs import QueueResults
|
|
10
10
|
from most_queue.theory.base_queue import BaseQueue
|
|
11
11
|
from most_queue.theory.calc_params import CalcParams
|
|
12
12
|
from most_queue.theory.utils.conv import conv_moments
|
|
@@ -8,8 +8,8 @@ import time
|
|
|
8
8
|
import numpy as np
|
|
9
9
|
from scipy.misc import derivative
|
|
10
10
|
|
|
11
|
-
from most_queue.distributions import H2Distribution
|
|
12
|
-
from most_queue.
|
|
11
|
+
from most_queue.random.distributions import H2Distribution
|
|
12
|
+
from most_queue.structs import QueueResults
|
|
13
13
|
from most_queue.theory.base_queue import BaseQueue
|
|
14
14
|
from most_queue.theory.calc_params import TakahashiTakamiParams
|
|
15
15
|
from most_queue.theory.utils.conv import conv_moments
|
most_queue/theory/fifo/mmnr.py
CHANGED
|
@@ -5,8 +5,8 @@ Calculate queue M/M/n/r
|
|
|
5
5
|
import math
|
|
6
6
|
import time
|
|
7
7
|
|
|
8
|
-
from most_queue.distributions import ExpDistribution
|
|
9
|
-
from most_queue.
|
|
8
|
+
from most_queue.random.distributions import ExpDistribution
|
|
9
|
+
from most_queue.structs import QueueResults
|
|
10
10
|
from most_queue.theory.base_queue import BaseQueue
|
|
11
11
|
from most_queue.theory.utils.conv import conv_moments
|
|
12
12
|
|