y_petri 2.1.25 → 2.1.26
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.
- checksums.yaml +4 -4
- data/lib/y_petri/core/timed/gillespie.rb +6 -6
- data/lib/y_petri/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97f8dea11788b703fdba22f532c5daa73dba17d8
|
4
|
+
data.tar.gz: b3682c83a6c8e724ba1cf84b64064ebf1c5270e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffc59f53f2ad898c577ba2a0ef098e98aa37522db63015d161d2e9803c1897d46ff37504f5dd2c2b7873a3223433606e4daf7436be5611d0e916947633cc9d4d
|
7
|
+
data.tar.gz: 9fd874f7a448b30a9f6b8f2f295cd0816abd29c3668660dc8382bdb98bc8c5ad2d044a6cea03a9267c06028a516cc67bc7904534fab2e2df4c23ababa6621617
|
@@ -26,7 +26,7 @@ module YPetri::Core::Timed::Gillespie
|
|
26
26
|
Kernel::p propensities
|
27
27
|
update_next_gillespie_time( propensities )
|
28
28
|
until ( @next_gillespie_time > target_time )
|
29
|
-
gillespie_step!
|
29
|
+
gillespie_step! propensities
|
30
30
|
note_state_change
|
31
31
|
propensities = propensity_vector_TS
|
32
32
|
update_next_gillespie_time( propensities )
|
@@ -64,11 +64,11 @@ module YPetri::Core::Timed::Gillespie
|
|
64
64
|
# Chooses the transition to fire.
|
65
65
|
#
|
66
66
|
def choose_TS_transition( propensities )
|
67
|
-
n = rng.rand
|
68
|
-
propensities.index do |propensity|
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
n = rng.rand * Σ( propensities )
|
68
|
+
transitions[ propensities.index do |propensity|
|
69
|
+
n -= propensity
|
70
|
+
n <= 0
|
71
|
+
end ]
|
72
72
|
end
|
73
73
|
|
74
74
|
# Fires a transition.
|
data/lib/y_petri/version.rb
CHANGED