Interface ContinuousDistribution.Sampler
- Enclosing interface:
ContinuousDistribution
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Distribution sampling functionality.
-
Method Summary
Modifier and TypeMethodDescriptiondoublesample()Generates a random value sampled from this distribution.default DoubleStreamsamples()Returns an effectively unlimited stream ofdoublesample values.default DoubleStreamsamples(long streamSize) Returns a stream producing the givenstreamSizenumber ofdoublesample values.
-
Method Details
-
sample
double sample()Generates a random value sampled from this distribution.- Returns:
- a random value.
-
samples
Returns an effectively unlimited stream ofdoublesample values.The default implementation produces a sequential stream that repeatedly calls
sample().- Returns:
- a stream of
doublevalues.
-
samples
Returns a stream producing the givenstreamSizenumber ofdoublesample values.The default implementation produces a sequential stream that repeatedly calls
sample(); the stream is limited to the givenstreamSize.- Parameters:
streamSize- Number of values to generate.- Returns:
- a stream of
doublevalues.
-