mpbn 4.1__py3-none-any.whl → 4.2__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.
Potentially problematic release.
This version of mpbn might be problematic. Click here for more details.
- mpbn/simulation.py +4 -2
- {mpbn-4.1.dist-info → mpbn-4.2.dist-info}/METADATA +2 -2
- {mpbn-4.1.dist-info → mpbn-4.2.dist-info}/RECORD +6 -6
- {mpbn-4.1.dist-info → mpbn-4.2.dist-info}/WHEEL +1 -1
- {mpbn-4.1.dist-info → mpbn-4.2.dist-info}/entry_points.txt +0 -0
- {mpbn-4.1.dist-info → mpbn-4.2.dist-info}/top_level.txt +0 -0
mpbn/simulation.py
CHANGED
|
@@ -188,7 +188,7 @@ def sample_reachable_attractor(f, mem, x, A, depth, W, refresh_rate=10, emit=Non
|
|
|
188
188
|
I = set(f)
|
|
189
189
|
n = len(f)
|
|
190
190
|
def filter_reachable_attractors(A, x):
|
|
191
|
-
H = spread(f, x, I, n)
|
|
191
|
+
H = spread(f, x, I, n)
|
|
192
192
|
return [(ia,a) for (ia,a) in A if is_subhypercube(a, (x,H))]
|
|
193
193
|
k = 1
|
|
194
194
|
x = x.copy()
|
|
@@ -201,7 +201,7 @@ def sample_reachable_attractor(f, mem, x, A, depth, W, refresh_rate=10, emit=Non
|
|
|
201
201
|
if k % refresh_rate == 0:
|
|
202
202
|
A = filter_reachable_attractors(A, x)
|
|
203
203
|
k += 1
|
|
204
|
-
return A[0][0]
|
|
204
|
+
return None if (len(A)==0) else A[0][0]
|
|
205
205
|
|
|
206
206
|
def sample_trace(f, mem, x, A, depth, W):
|
|
207
207
|
if not isinstance(f, MPBNSim): f = MPBNSim(f)
|
|
@@ -257,6 +257,8 @@ def estimate_reachable_attractors_probabilities(f, x, A, nb_sims, depth, W):
|
|
|
257
257
|
C = {ia: 0 for (ia,_) in A}
|
|
258
258
|
for _ in tqdm(range(nb_sims)):
|
|
259
259
|
ia = sample_reachable_attractor(f, mem, x, A, depth, W)
|
|
260
|
+
if (ia is None):
|
|
261
|
+
continue
|
|
260
262
|
C[ia] += 1
|
|
261
263
|
for ia, _ in A:
|
|
262
264
|
C[ia] = (C[ia]*100) / nb_sims
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
mpbn/__init__.py,sha256=kbHB9JR5z2XP3FNaf2F06X9TaJM3PVVHzAsltT0_awg,22903
|
|
2
2
|
mpbn/converters.py,sha256=6uCjxaJ2MI19_I1h0Pk9YN6PcDx42_C-Ml8ZRMA9uxg,416
|
|
3
|
-
mpbn/simulation.py,sha256=
|
|
3
|
+
mpbn/simulation.py,sha256=DBtJbj1wyarHIbDcxLIuyWRNt2PRbiTjZxwB97cCAvE,10663
|
|
4
4
|
mpbn/asplib/eval_circuit.asp,sha256=5rIbkVmvobaQwE_gHr0_USccPuI0QUPuzfw_1011hSE,989
|
|
5
5
|
mpbn/asplib/eval_mixed.asp,sha256=n23pbjtxuWSCerL36Gb6O32bx8_1ukc52l1hQMMs8OE,787
|
|
6
6
|
mpbn/asplib/mp_attractor.asp,sha256=CawLNxlYBZG2cl8XQAxA6EXEZ89Y9iw20CZ73n97Nu8,185
|
|
@@ -18,8 +18,8 @@ tests/test_fixpoints.py,sha256=bdDttzimiby48nVkVL-HXZ2rBldICBRbIZrVVbTGfso,786
|
|
|
18
18
|
tests/test_input.py,sha256=mwMKd5UwAIY4Z1uZjYr09Ue8DLxD52CiPSoE-iXytfo,337
|
|
19
19
|
tests/test_reachability.py,sha256=X7anTwFSIYcV2rltJBOW8TcAJnrt3SjYLqttB0eIL_Q,588
|
|
20
20
|
tests/test_reachable_attractors.py,sha256=h78kvgmx9rTJWi3r2DZe_abYDxr02MLJ2iLDJUdLESY,540
|
|
21
|
-
mpbn-4.
|
|
22
|
-
mpbn-4.
|
|
23
|
-
mpbn-4.
|
|
24
|
-
mpbn-4.
|
|
25
|
-
mpbn-4.
|
|
21
|
+
mpbn-4.2.dist-info/METADATA,sha256=BmmvG9KnkobRLLLw6x8V5tNJe2fAg1mJg6yzc18kg64,2364
|
|
22
|
+
mpbn-4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
+
mpbn-4.2.dist-info/entry_points.txt,sha256=CpzAc9SkB-mH_dojzt1N3YgDxy8hniDrIGzSHcPDo8g,68
|
|
24
|
+
mpbn-4.2.dist-info/top_level.txt,sha256=oe3jlFHbQ6oIXyE1q7yAAnf1m49oP_jBPUU05d71n74,11
|
|
25
|
+
mpbn-4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|