Class DEmpiricalList<T>

    • Field Detail

      • myElements

        protected final java.util.List<T> myElements
      • myCDF

        protected final double[] myCDF
    • Constructor Detail

      • DEmpiricalList

        public DEmpiricalList​(java.util.List<T> elements,
                              double[] cdf)
        Parameters:
        elements - the list of elements, must not be null
        cdf - an array holding the cumulative probabilities across the elements in the list
      • DEmpiricalList

        public DEmpiricalList​(java.util.List<T> elements,
                              double[] cdf,
                              RNStreamIfc rng)
        Parameters:
        elements - the list of elements, must not be null
        cdf - an array holding the cumulative probabilities across the elements in the list
        rng - the underlying random number stream to use for randomness
    • Method Detail

      • getCDF

        public double[] getCDF()
        Returns:
        a copy of the underlying CDF array
      • getRandomElement

        public T getRandomElement()
        Description copied from interface: RElementIfc
        Returns an element randomly selected from the list
        Specified by:
        getRandomElement in interface RElementIfc<T>
        Returns:
        a randomly selected element from the list
      • resetStartStream

        public void resetStartStream()
        Description copied from interface: RNStreamControlIfc
        The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.
        Specified by:
        resetStartStream in interface RNStreamControlIfc
      • setAntitheticOption

        public void setAntitheticOption​(boolean flag)
        Description copied from interface: RNStreamControlIfc
        Tells the stream to start producing antithetic variates
        Specified by:
        setAntitheticOption in interface RNStreamControlIfc
        Parameters:
        flag - true means that it produces antithetic variates.
      • contains

        public final boolean contains​(java.lang.Object arg0)
      • containsAll

        public final boolean containsAll​(java.util.Collection<?> arg0)
      • indexOf

        public final int indexOf​(java.lang.Object arg0)
      • isEmpty

        public final boolean isEmpty()
      • size

        public final int size()
      • getList

        public final java.util.List<T> getList()
      • main

        public static void main​(java.lang.String[] args)