Package org.apache.commons.rng.sampling
Class CompositeSamplers.SharedStateObjectSamplerFactory.CompositeSharedStateObjectSampler<T>
java.lang.Object
org.apache.commons.rng.sampling.CompositeSamplers.CompositeSampler<SharedStateObjectSampler<T>>
org.apache.commons.rng.sampling.CompositeSamplers.SharedStateObjectSamplerFactory.CompositeSharedStateObjectSampler<T>
- Type Parameters:
T
- Type of sample
- All Implemented Interfaces:
ObjectSampler<T>
,SharedStateObjectSampler<T>
,SharedStateSampler<SharedStateObjectSampler<T>>
- Enclosing class:
CompositeSamplers.SharedStateObjectSamplerFactory<T>
private static class CompositeSamplers.SharedStateObjectSamplerFactory.CompositeSharedStateObjectSampler<T>
extends CompositeSamplers.CompositeSampler<SharedStateObjectSampler<T>>
implements SharedStateObjectSampler<T>
A composite object sampler with shared state support.
The source sampler for each sampler is chosen based on a user-defined discrete probability distribution.
-
Field Summary
Fields inherited from class org.apache.commons.rng.sampling.CompositeSamplers.CompositeSampler
discreteSampler, samplers
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeSharedStateObjectSampler
(SharedStateDiscreteSampler discreteSampler, List<SharedStateObjectSampler<T>> samplers) -
Method Summary
Modifier and TypeMethodDescriptionsample()
Create an object sample.Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.Methods inherited from class org.apache.commons.rng.sampling.CompositeSamplers.CompositeSampler
nextSampler
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.rng.sampling.ObjectSampler
samples, samples
-
Constructor Details
-
Method Details
-
sample
Description copied from interface:ObjectSampler
Create an object sample.- Specified by:
sample
in interfaceObjectSampler<T>
- Returns:
- a sample.
-
withUniformRandomProvider
public CompositeSamplers.SharedStateObjectSamplerFactory.CompositeSharedStateObjectSampler<T> withUniformRandomProvider(UniformRandomProvider rng) Description copied from interface:SharedStateSampler
Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Specified by:
withUniformRandomProvider
in interfaceSharedStateSampler<T>
- Parameters:
rng
- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-