monte_carlo 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1045401a068ca8ca900b000ca47c36a2d3b9aaf
4
- data.tar.gz: 529e4a6ac17cd14dbba9a41b672202e23b83fabf
3
+ metadata.gz: e982e4c691d1727d209a88dd129a31b9118b6e26
4
+ data.tar.gz: 0fb0dba7ee9dcbad1c6c78faf14b4a370180326d
5
5
  SHA512:
6
- metadata.gz: 1f5ee56b4e2a2df819767c25e681de4d0103783aaf800922ea14680c119d2fd49d421128cb28038fcbd47d878e695770dc119d68c854e5a1868df51050883e37
7
- data.tar.gz: 0b4eac19c056cebc1efdf5e101654d591b443bb2ab4243013a2fa84cdbefa54ec43dfcd28d83418ad1277ed9d637e7dcec231427fc3d56619be706c7536b36bc
6
+ metadata.gz: 42aaa3bfb0fdf59aac78e3a810bb5f21083e4a2b30c1d3fb00e2155396cf37d18d0896e838a7002df93ff3e0d1cc63892dc2cdc270bf7f583ecec7f83c33d504
7
+ data.tar.gz: c5038110cc5a7109caf001a33b8d35e22458431f370c94f4310d3535d1889a3ccbc4cdbe6c0a1055a7b338a3c73f47ac7422263b0d9ceb62a4ef4fbf7acc14ca
data/README.md CHANGED
@@ -21,6 +21,7 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  Every `MonteCarlo::Experiment` must have a sample method to generate random samples. The samples generated when the experiment is run will be collected into a `MonteCarlo::ExperimentResults` object after an optional computation method to turn the random sample into a meaningful value.
24
+
24
25
  For example, the sample method may draw a random number between 1 and 10 and the computation method will test whether the number is greater than 5, returning `true` or `false` results.
25
26
 
26
27
  ```ruby
@@ -39,6 +40,14 @@ results.probability_distribution
39
40
 
40
41
  Or run it with the shorthand class method syntax:
41
42
 
43
+ ```ruby
44
+ # Use one method for both sample and computation and run immediately
45
+ results = MonteCarlo::Experiment.run(1000000) do
46
+ sample = rand(10)
47
+ sample >= 5
48
+ end
49
+ ```
50
+
42
51
  ## Docs
43
52
 
44
53
  [Can be found here](http://www.rubydoc.info/gems/monte_carlo)
@@ -2,6 +2,6 @@ module MonteCarlo
2
2
 
3
3
  # Current version
4
4
  # @return [String]
5
- VERSION = "0.0.6"
5
+ VERSION = "0.0.7"
6
6
 
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monte_carlo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Assaf Gelber