Class CollectionSampler<T>

    • Field Detail

      • items

        private final java.util.List<T> items
        Collection to be sampled from.
    • Constructor Detail

      • CollectionSampler

        public CollectionSampler​(UniformRandomProvider rng,
                                 java.util.Collection<T> collection)
        Creates a sampler.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        collection - Collection to be sampled. A (shallow) copy will be stored in the created instance.
        Throws:
        java.lang.IllegalArgumentException - if collection is empty.
      • CollectionSampler

        private CollectionSampler​(UniformRandomProvider rng,
                                  CollectionSampler<T> source)
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        source - Source to copy.