Class BinomialRV

    • Constructor Detail

      • BinomialRV

        public BinomialRV​(double pSuccess,
                          int numTrials)
        Parameters:
        pSuccess - the probability of success, must be in (0,1)
        numTrials - the number of trials, must be greater than 0
      • BinomialRV

        public BinomialRV​(double pSuccess,
                          int numTrials,
                          int streamNum)
        Parameters:
        pSuccess - the probability of success, must be in (0,1)
        numTrials - the number of trials, must be greater than 0
        streamNum - the stream number from the stream provider to use
      • BinomialRV

        public BinomialRV​(double pSuccess,
                          int numTrials,
                          RNStreamIfc stream)
        Parameters:
        pSuccess - the probability of success, must be in (0,1)
        numTrials - the number of trials, must be greater than 0
        stream - the stream from the stream provider to use
    • Method Detail

      • newInstance

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

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

        public double getProb()
        Gets the success probability
        Returns:
        The success probability
      • getTrials

        public int getTrials()
        Gets the number of trials
        Returns:
        the number of trials
      • generate

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

        public static RVControls makeControls()
        The keys are "ProbOfSuccess", the default value is 0.5 and "NumTrials" with default value 2. NumTrials is an Integer control and ProbOfSuccess is a Double control.
        Returns:
        a control for Binomial random variables