MCpiResults is used to create the final totals of the number of iterations and the number of points within the unit circle.
iterationSum
- the total number of iterations generated by the FarmwithinSum
- the total sum of the number of random points that are within the unit circleConstructor and description |
---|
MCpiResults
() |
Type Params | Return Type | Name and description |
---|---|---|
|
int |
collector(def o) Implements the collector method and is used to create the required running sums of total iterations and the number of points within the unit circle |
|
int |
finalise(List p) Finalise is used to calculate the value of pi and then print out the result |
|
int |
initClass(List d) Initialises the class but in this case nothing needs to be done |
Implements the collector method and is used to create the required running sums of total iterations and the number of points within the unit circle
o
- this parameter will be passed as a reference to a MCpiData objectFinalise is used to calculate the value of pi and then print out the result
p
- nullInitialises the class but in this case nothing needs to be done
d
- nullDemonstrations of the Use of the Groovy Parallel Patterns Library generated 18-09-2017 by Jon Kerridge, Edinburgh Napier University - j.kerridge@napier.ac.uk