Class RNStreamFactory.RNStream

    • Method Detail

      • getName

        public final java.lang.String getName()
        Specified by:
        getName in interface GetNameIfc
        Returns:
        a string representing the name of the object
      • getId

        public final int getId()
        Specified by:
        getId in interface IdentityIfc
        Returns:
        an int representing the id of the object
      • setName

        public final void setName​(java.lang.String str)
        Sets the name
        Parameters:
        str - The name as a string.
      • resetStartStream

        public final 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
      • getStartSubStreamSeed

        public final long[] getStartSubStreamSeed()
        Returns the seed for the start of the substream
        Returns:
        the seed for the start of the substream
      • setAntitheticOption

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

        public final long[] getState()
        Returns the current state C_g of this stream. This is a vector of 6 integers. This method is convenient if we want to save the state for subsequent use.
        Returns:
        the current state of the generator
      • randU01

        public final double randU01()
        Description copied from interface: RandU01Ifc
        Returns a pseudo-random uniformly distributed number
        Specified by:
        randU01 in interface RandU01Ifc
        Returns:
        the random number
      • getPrevU01

        public final double getPrevU01()
        Description copied from interface: RandU01Ifc
        The previous U(0,1) generated (returned) by randU01()
        Specified by:
        getPrevU01 in interface RandU01Ifc
        Returns:
        previous U(0,1) generated (returned) by randU01()
      • randInt

        public final int randInt​(int i,
                                 int j)
        Description copied from interface: RNStreamIfc
        Returns a (pseudo)random number from the discrete uniform distribution over the integers {i, i + 1, . . . , j }, using this stream. Calls randU01 once.
        Specified by:
        randInt in interface RNStreamIfc
        Parameters:
        i - start of range
        j - end of range
        Returns:
        The integer pseudo random number
      • toString

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