y_petri 2.1.24 → 2.1.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11b347e148cffde329b5fd9e3fb104f302e4066a
4
- data.tar.gz: 37450ab4794d26f0af7ba7055fa8ffe8d59975d4
3
+ metadata.gz: 030fcecf74aac2f5368653e8da16153bcf2e7049
4
+ data.tar.gz: 71a2bf7fa5ad36779ae3402ac4bf6a80478a971e
5
5
  SHA512:
6
- metadata.gz: 62f0f1af0ad89d1db56f134cadbc3d23065740e4967c4771392cfc341c91e2cf070e3e449c2beaa337bb2ae76b47ed51d87cc5fbf9533383ce8d772cf56ede3a
7
- data.tar.gz: 65dd95f028636d47da4d9068938825845eefc32117e9151afbe60be6dd0092e2e51cfff1deb341f60a9ed397a8f826825269dd12d337aa3e8307a2607e2454f4
6
+ metadata.gz: df9f49e6fbcb9727109a565b06465fb172a4bba0f1fc3762175cc9f4f8a790257eb640ff46cbe998fd58ada72dfe58e31d726bb171da16e2e0ae88b7996c19c8
7
+ data.tar.gz: 5046af4b8050a2169d402be60e805bebbe9b9909a3158170816c57b499e1c8ffc20d79824cde399269293f6be3ebac2788ebfa62f95247bb4c69c70cac9802ef
data/README.md CHANGED
@@ -55,13 +55,11 @@ We can now play the _token_ _game_:
55
55
  ## Advanced usage
56
56
 
57
57
  A Petri net is mostly used as a wiring diagram of some real-world system. Such
58
- Petri net can then be used to generate (implicitly or explicitly) a more specific
59
- simulation of that real-world system. This is represented by `YPetri::Simulation`
60
- class. If a Petri net with only _timed_ transitions is considered, it can then
61
- be used to generate (implicitly or explicitly) a system of ordinary differential
62
- equations (ODE). A Simulation class instance generated from such Petri net can
63
- then be used to eg. solve the initial value problem by numeric integration of the
64
- ODE system using one of the available numerical methods:
58
+ Petri net can then be used to generate its simulation -- represented by
59
+ `YPetri::Simulation` class. A Petri net consisting of only _timed_ transitions
60
+ can be used to generate (implicitly or explicitly) a system of ordinary
61
+ differential equations (ODE). A simulation generated from such Petri net can
62
+ then be used to solve (eg.) the initial value problem by numeric methods:
65
63
  ```ruby
66
64
  # Start a fresh irb session!
67
65
  require 'y_petri'
@@ -19,17 +19,17 @@ module YPetri::Core::Timed::Gillespie
19
19
  # Makes a stochastic number of Gillespie steps necessary to span the period Δt.
20
20
  #
21
21
  def step! Δt=simulation.step
22
- current_time = simulation.time
23
- target_time = current_time + Δt
24
- @gillespie_time = current_time
22
+ @gillespie_time = curr_time = simulation.time
23
+ target_time = curr_time + Δt
25
24
  propensities = propensity_vector_TS
26
25
  puts "Propensity vector TS is:"
27
26
  Kernel::p propensities
28
- gillespie_update_next_firing_time( propensities )
29
- until ( @gillespie_next_firing_time > target_time )
27
+ update_next_gillespie_time( propensities )
28
+ until ( @next_gillespie_time > target_time )
30
29
  gillespie_step!
30
+ note_state_change
31
31
  propensities = propensity_vector_TS
32
- gillespie_update_next_firing_time( propensities )
32
+ update_next_gillespie_time( propensities )
33
33
  end
34
34
  end
35
35
 
@@ -41,8 +41,8 @@ module YPetri::Core::Timed::Gillespie
41
41
 
42
42
  # This method updates next firing time given propensities.
43
43
  #
44
- def gillespie_update_next_firing_time( propensities )
45
- @gillespie_next_firing_time =
44
+ def update_next_gillespie_time( propensities )
45
+ @next_gillespie_time =
46
46
  @gillespie_time + gillespie_delta_time( propensities )
47
47
  end
48
48
 
@@ -1,4 +1,4 @@
1
1
  module YPetri
2
- VERSION = "2.1.24"
2
+ VERSION = "2.1.25"
3
3
  DEBUG = false
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: y_petri
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.24
4
+ version: 2.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - boris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-19 00:00:00.000000000 Z
11
+ date: 2013-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: y_support