- All Implemented Interfaces:
- Serializable, Function, MapFunction<Long,Long>
- Enclosing class:
- PiEstimation
public static class PiEstimation.Sampler
extends Object
implements MapFunction<Long,Long>
Sampler randomly emits points that fall within a square of edge x * y.
It calculates the distance to the center of a virtually centered circle of radius x = y = 1
If the distance is less than 1, then and only then does it returns a 1.
- See Also:
- Serialized Form