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 final 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
nextSamplerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.rng.sampling.ObjectSampler
samples, samples
-
Constructor Details
-
Method Details
-
sample
Description copied from interface:ObjectSamplerCreate an object sample.- Specified by:
samplein interfaceObjectSampler<T>- Returns:
- a sample.
-
withUniformRandomProvider
public CompositeSamplers.SharedStateObjectSamplerFactory.CompositeSharedStateObjectSampler<T> withUniformRandomProvider(UniformRandomProvider rng) Description copied from interface:SharedStateSamplerCreate a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Specified by:
withUniformRandomProviderin interfaceSharedStateSampler<T>- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-