README.md in monte_carlo-0.0.3 vs README.md in monte_carlo-0.0.4

- old
+ new

@@ -1,6 +1,6 @@ -# MonteCarlo +# MonteCarlo [![Build Status](https://travis-ci.org/agelber/monte_carlo.svg)](https://travis-ci.org/agelber/monte_carlo) A utility to write quick [Monte Carlo Method](http://en.wikipedia.org/wiki/Monte_Carlo_method) experiments. ## Installation @@ -40,13 +40,27 @@ # Run your experiment and get your results results = experiment.run ``` -Alternatively, you can write your sample and computation method as one with the shorthand block syntax: +Another options is to use the configuration DSL, like so: ```ruby +# Create an experiment and pass it a configuration block +experiment = MonteCarlo::Experiment.new do + times 1000000 + sample_method { rand } + compuation { |sample| sample > 0.5 } +end + +# And run it normally +results = experiment.run +``` + +Alternatively, you can write your sample and computation method as one with the shorthand block syntax and get the restults straight away: + +```ruby results = MonteCarlo::Experiment.run(100000) { rand > 0.5 } ``` The experiment returns a `MonteCarlo::ExperimentResults` object which contains an array of `MonteCarlo::Results` as well as some other handy methods. @@ -57,10 +71,10 @@ If no computation method was given, `value` and `sample_value` will be the same. ## Contributing -1. Fork it ( https://github.com/[agelber]/monte_carlo/fork ) +1. Fork it ( https://github.com/agelber/monte_carlo/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request