mg-pso-gui 0.1.127__py3-none-any.whl → 0.1.128__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.
- {mg_pso_gui-0.1.127.dist-info → mg_pso_gui-0.1.128.dist-info}/METADATA +1 -1
- {mg_pso_gui-0.1.127.dist-info → mg_pso_gui-0.1.128.dist-info}/RECORD +14 -9
- mgpsogui/util/PSORunner.py +1 -1
- mgpsogui/util/recosu/__init__.py +2 -1
- mgpsogui/util/recosu/sampling/__init__.py +7 -0
- mgpsogui/util/recosu/sampling/halton/__init__.py +0 -0
- mgpsogui/util/recosu/sampling/halton/halton.py +45 -0
- mgpsogui/util/recosu/sampling/halton/prime.py +82 -0
- mgpsogui/util/recosu/sampling/random/__init__.py +0 -0
- mgpsogui/util/recosu/sampling/random/random_sampler.py +34 -0
- {mg_pso_gui-0.1.127.dist-info → mg_pso_gui-0.1.128.dist-info}/WHEEL +0 -0
- {mg_pso_gui-0.1.127.dist-info → mg_pso_gui-0.1.128.dist-info}/entry_points.txt +0 -0
- {mg_pso_gui-0.1.127.dist-info → mg_pso_gui-0.1.128.dist-info}/top_level.txt +0 -0
- /mgpsogui/util/recosu/sampling/{sampler.py → sampling.py} +0 -0
|
@@ -33,28 +33,33 @@ mgpsogui/gui/images/test.png,sha256=MUnVpRK-isxhEHzx4Q6Yh0M6FRZD1qvgCHH2XmiSBbk,
|
|
|
33
33
|
mgpsogui/gui/images/trash.png,sha256=j8cf0kWbJd-4Jp20lUVV1o1NSeQ4v1Ej4gfcIA3DVRQ,2958
|
|
34
34
|
mgpsogui/gui/images/up.png,sha256=AQvFWCUqSQNaQ1E6LKZ9zNfSvW6t4mgy8uswdg9T2Hg,2457
|
|
35
35
|
mgpsogui/util/GraphGenerator.py,sha256=HhUsFUFhCv3wTYV8CTqU0wo56Ph9c1DocPj25AVIAdI,15076
|
|
36
|
-
mgpsogui/util/PSORunner.py,sha256=
|
|
36
|
+
mgpsogui/util/PSORunner.py,sha256=YmzsZbbTH8axrwJYq7ypCiOeMW4w4dnoLquv1mSGKSU,5729
|
|
37
37
|
mgpsogui/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
mgpsogui/util/debug.py,sha256=Swzny9_1S-CCONWGssj9iDoSpbwu5Vr4f95g_9L8bec,19759
|
|
39
39
|
mgpsogui/util/helpers.py,sha256=fCfVDaGholx16FVVqf2BhWs9KCevI7aFIve1w2W68EQ,769
|
|
40
40
|
mgpsogui/util/sampler_test_driver.py,sha256=1iJTLVFZ_VCsuIdl3mXQBA1GNAH5jJO3z5h4E_bd5U8,3703
|
|
41
41
|
mgpsogui/util/CTkToolTip/__init__.py,sha256=G1jxV55hGtGgwyC1sR-uUUdasDdh0XZgcI-aILgGYA0,225
|
|
42
42
|
mgpsogui/util/CTkToolTip/ctk_tooltip.py,sha256=SZMovpQIGvdpDRbqCKl9SHs92DrFCO2MOYL2ifolvOE,6329
|
|
43
|
-
mgpsogui/util/recosu/__init__.py,sha256=
|
|
43
|
+
mgpsogui/util/recosu/__init__.py,sha256=pPR0lB6clIi6q73H1W8eT5u0dd3bIemwa9-XFmOaVVk,279
|
|
44
44
|
mgpsogui/util/recosu/pso/__init__.py,sha256=PQ548aEKVOk6MMzxxDg7yMO_1hHfoEoYLLkGLeij73Y,247
|
|
45
45
|
mgpsogui/util/recosu/pso/csip_access.py,sha256=jBli1MSShUUwQCMKOUvMaGuNwBViCrjXJi_FmSEJsZA,2721
|
|
46
46
|
mgpsogui/util/recosu/pso/pso.py,sha256=iPqT6aI1vi8LYuWmtxuHkLEM9sQwhUznPInBgps7ANI,13708
|
|
47
|
-
mgpsogui/util/recosu/sampling/__init__.py,sha256=
|
|
47
|
+
mgpsogui/util/recosu/sampling/__init__.py,sha256=dWs1MPx0o2UFmOmUfFaomQWBTIZAwALsVJzZQNZePZU,252
|
|
48
48
|
mgpsogui/util/recosu/sampling/sample_trace_writer.py,sha256=M9w-POLlZgjL5a7J7yxr73OG6mCsS2aUuP9d3HKfkbA,1966
|
|
49
|
-
mgpsogui/util/recosu/sampling/sampler.py,sha256=2Z3K26_CL-HSRkdLgFwRp-QTLXPYLxYzynDItKPj8Jk,4138
|
|
50
49
|
mgpsogui/util/recosu/sampling/sampler_task.py,sha256=uZobpR83u6xEaUzIknvW9FbB84c2AL7T-5T8O8QIhzY,2776
|
|
50
|
+
mgpsogui/util/recosu/sampling/sampling.py,sha256=2Z3K26_CL-HSRkdLgFwRp-QTLXPYLxYzynDItKPj8Jk,4138
|
|
51
|
+
mgpsogui/util/recosu/sampling/halton/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
|
+
mgpsogui/util/recosu/sampling/halton/halton.py,sha256=pqJ9yi-tqixwmr6Nfd4TQeD-5QjswoggVj-kn5ro0C4,1214
|
|
53
|
+
mgpsogui/util/recosu/sampling/halton/prime.py,sha256=gOWJWdFVthmFAt-8Utk856QlJ3IKxBvg9eDfOJOWdr0,4206
|
|
54
|
+
mgpsogui/util/recosu/sampling/random/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
+
mgpsogui/util/recosu/sampling/random/random_sampler.py,sha256=cVF2VA40v9h0OSBgwXCKMw4wJGaQnUfBdwVPMffk_9U,905
|
|
51
56
|
mgpsogui/util/recosu/utils/__init__.py,sha256=TXz_TpNif2GeGu22pzTnkUQvaP-PmLQ9Sz4BgMIS6ig,196
|
|
52
57
|
mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvarrMRXJMbDBWqI8,3023
|
|
53
58
|
mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
|
|
54
59
|
mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
|
|
55
60
|
mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
|
|
56
|
-
mg_pso_gui-0.1.
|
|
57
|
-
mg_pso_gui-0.1.
|
|
58
|
-
mg_pso_gui-0.1.
|
|
59
|
-
mg_pso_gui-0.1.
|
|
60
|
-
mg_pso_gui-0.1.
|
|
61
|
+
mg_pso_gui-0.1.128.dist-info/METADATA,sha256=vfBQZXJSgrrdY9M2wsbQBf_4N5TobG0sPNPdFe5txqM,9460
|
|
62
|
+
mg_pso_gui-0.1.128.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
63
|
+
mg_pso_gui-0.1.128.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
|
|
64
|
+
mg_pso_gui-0.1.128.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
|
|
65
|
+
mg_pso_gui-0.1.128.dist-info/RECORD,,
|
mgpsogui/util/PSORunner.py
CHANGED
mgpsogui/util/recosu/__init__.py
CHANGED
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from collections.abc import Iterable
|
|
2
|
+
import math
|
|
3
|
+
from recosu.sampling.halton.prime import generate_n_primes
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def halton(index: int, base: int) -> float:
|
|
7
|
+
fraction: float = 1.0
|
|
8
|
+
result: float = 0
|
|
9
|
+
|
|
10
|
+
while index > 0:
|
|
11
|
+
fraction = fraction / base
|
|
12
|
+
result += fraction * (index % base)
|
|
13
|
+
index = math.floor(index / base)
|
|
14
|
+
|
|
15
|
+
return result
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class HaltonSampleGenerator:
|
|
19
|
+
index: int
|
|
20
|
+
maxIndex: int
|
|
21
|
+
primes: list[int]
|
|
22
|
+
|
|
23
|
+
def __init__(self, count: int, offset: int, num_parameters: int):
|
|
24
|
+
assert (count > 0)
|
|
25
|
+
assert (offset >= 0)
|
|
26
|
+
self.index = offset + 1
|
|
27
|
+
self.maxIndex = offset + count + 1
|
|
28
|
+
self.primes = generate_n_primes(num_parameters)
|
|
29
|
+
|
|
30
|
+
def __iter__(self) -> Iterable[tuple[int, list[float]]]:
|
|
31
|
+
return self
|
|
32
|
+
|
|
33
|
+
def __next__(self) -> tuple[int, list[float]]:
|
|
34
|
+
if self.index >= self.maxIndex:
|
|
35
|
+
raise StopIteration
|
|
36
|
+
|
|
37
|
+
i = 0
|
|
38
|
+
values: list[float] = []
|
|
39
|
+
for base in self.primes:
|
|
40
|
+
values.append(halton(self.index, base))
|
|
41
|
+
|
|
42
|
+
result: tuple[int, list[float]] = (self.index, values)
|
|
43
|
+
self.index = self.index + 1
|
|
44
|
+
return result
|
|
45
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
PRIME_TABLE: List[int] = [
|
|
4
|
+
2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
|
|
5
|
+
31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
|
|
6
|
+
73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
|
|
7
|
+
127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
|
|
8
|
+
179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
|
|
9
|
+
233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
|
|
10
|
+
283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
|
|
11
|
+
353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
|
|
12
|
+
419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
|
|
13
|
+
467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
|
|
14
|
+
547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
|
|
15
|
+
607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
|
|
16
|
+
661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
|
|
17
|
+
739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
|
|
18
|
+
811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
|
|
19
|
+
877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
|
|
20
|
+
947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013,
|
|
21
|
+
1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069,
|
|
22
|
+
1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,
|
|
23
|
+
1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
|
|
24
|
+
1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291,
|
|
25
|
+
1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373,
|
|
26
|
+
1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,
|
|
27
|
+
1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,
|
|
28
|
+
1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583,
|
|
29
|
+
1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657,
|
|
30
|
+
1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,
|
|
31
|
+
1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,
|
|
32
|
+
1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,
|
|
33
|
+
1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987,
|
|
34
|
+
1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,
|
|
35
|
+
2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129,
|
|
36
|
+
2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213,
|
|
37
|
+
2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287,
|
|
38
|
+
2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,
|
|
39
|
+
2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423,
|
|
40
|
+
2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531,
|
|
41
|
+
2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617,
|
|
42
|
+
2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,
|
|
43
|
+
2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741,
|
|
44
|
+
2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819,
|
|
45
|
+
2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903,
|
|
46
|
+
2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,
|
|
47
|
+
3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079,
|
|
48
|
+
3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181,
|
|
49
|
+
3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257,
|
|
50
|
+
3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,
|
|
51
|
+
3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413,
|
|
52
|
+
3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511,
|
|
53
|
+
3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571,
|
|
54
|
+
3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,
|
|
55
|
+
3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727,
|
|
56
|
+
3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821,
|
|
57
|
+
3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907,
|
|
58
|
+
3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,
|
|
59
|
+
4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057,
|
|
60
|
+
4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139,
|
|
61
|
+
4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231,
|
|
62
|
+
4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,
|
|
63
|
+
4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def generate_n_primes(n: int) -> List[int]:
|
|
68
|
+
if n < len(PRIME_TABLE):
|
|
69
|
+
return PRIME_TABLE[0:n]
|
|
70
|
+
|
|
71
|
+
primes: List[int] = PRIME_TABLE.copy()
|
|
72
|
+
num: int = primes[-1] + 2
|
|
73
|
+
while len(primes) < n:
|
|
74
|
+
is_prime = True
|
|
75
|
+
for p in primes:
|
|
76
|
+
if num % p == 0:
|
|
77
|
+
is_prime = False
|
|
78
|
+
break
|
|
79
|
+
if is_prime:
|
|
80
|
+
primes.append(num)
|
|
81
|
+
num += 2
|
|
82
|
+
return primes
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from collections.abc import Iterable
|
|
2
|
+
import random
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class RandomSampleGenerator:
|
|
6
|
+
index: int
|
|
7
|
+
count: int
|
|
8
|
+
num_parameters: int
|
|
9
|
+
rand: random.Random
|
|
10
|
+
|
|
11
|
+
def __init__(self, count: int, num_parameters: int):
|
|
12
|
+
assert (count > 0)
|
|
13
|
+
self.index = 1
|
|
14
|
+
self.count = count + 1
|
|
15
|
+
self.num_parameters = num_parameters
|
|
16
|
+
self.rand = random.Random()
|
|
17
|
+
|
|
18
|
+
def __iter__(self) -> Iterable[tuple[int, list[float]]]:
|
|
19
|
+
return self
|
|
20
|
+
|
|
21
|
+
def __next__(self) -> tuple[int, list[float]]:
|
|
22
|
+
if self.index >= self.count:
|
|
23
|
+
raise StopIteration
|
|
24
|
+
|
|
25
|
+
i: int = 0
|
|
26
|
+
values: list[float] = []
|
|
27
|
+
while i < self.num_parameters:
|
|
28
|
+
values.append(self.rand.uniform(0, 1))
|
|
29
|
+
i = i + 1
|
|
30
|
+
|
|
31
|
+
result: tuple[int, list[float]] = (self.index, values)
|
|
32
|
+
self.index = self.index + 1
|
|
33
|
+
return result
|
|
34
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|