Class DEmpiricalRV

    • Constructor Detail

      • DEmpiricalRV

        public DEmpiricalRV​(double[] values,
                            double[] cdf)
        Randomly selects from the array using the supplied cdf
        Parameters:
        values - array to select from
        cdf - the cumulative probability associated with each element of array
      • DEmpiricalRV

        public DEmpiricalRV​(double[] values,
                            double[] cdf,
                            int streamNum)
        Randomly selects from the array using the supplied cdf
        Parameters:
        values - array to select from
        cdf - the cumulative probability associated with each element of array
        streamNum - the stream number
      • DEmpiricalRV

        public DEmpiricalRV​(double[] values,
                            double[] cdf,
                            RNStreamIfc rng)
        Randomly selects from the array using the supplied cdf
        Parameters:
        values - array to select from
        cdf - the cumulative probability associated with each element of array
        rng - the source of randomness
    • Method Detail

      • newInstance

        public DEmpiricalRV newInstance​(RNStreamIfc rng)
        Parameters:
        rng - the RNStreamIfc to use
        Returns:
        a new instance with same parameter value
      • getValues

        public double[] getValues()
        Returns:
        the values to select from
      • getCDF

        public double[] getCDF()
        Returns:
        the cdf to select with
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • generate

        protected double generate()
        Specified by:
        generate in class AbstractRVariable
        Returns:
        the randomly generated variate
      • makeControls

        public static RVControls makeControls()
        The keys are "values" with default an array {0.0, 1.0} and key "cdf" with default array {0.5, 1.0}
        Returns:
        a control for DEmpirical random variables