Class ConstantRV

    • Field Detail

      • ZERO

        public static final ConstantRV ZERO
        A constant to represent zero for sharing
      • ONE

        public static final ConstantRV ONE
        A constant to represent one for sharing
      • TWO

        public static final ConstantRV TWO
        A constant to represent two for sharing
      • POSITIVE_INFINITY

        public static final ConstantRV POSITIVE_INFINITY
        A constant to represent positive infinity for sharing
      • myValue

        protected double myValue
    • Constructor Detail

      • ConstantRV

        public ConstantRV​(double value)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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.
      • sample

        public final double sample()
        Specified by:
        sample in interface SampleIfc
        Returns:
        generates a random value
      • 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
      • setAntitheticOption

        public final 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.
      • getPreviousValue

        public double getPreviousValue()
        Description copied from interface: PreviousValueIfc
        Gets the previous number from the sequence of values
        Specified by:
        getPreviousValue in interface PreviousValueIfc
        Returns:
        a double representing the last value in the sequence
      • makeControls

        public static RVControls makeControls()
        The keys are "value", the default value is 1.0
        Returns:
        a control for Constant random variables