Class RandomElement<T>

    • Field Detail

      • myResetStartStreamOption

        protected boolean myResetStartStreamOption
        indicates whether or not the random variable's distribution has it stream reset to the default stream, or not prior to each experiment. Resetting allows each experiment to use the same underlying random numbers i.e. common random numbers, this is the default

        Setting it to true indicates that it does reset

      • myResetNextSubStreamOption

        protected boolean myResetNextSubStreamOption
        indicates whether or not the random variable's distribution has it stream reset to the next substream stream, or not, prior to each replication. Resetting allows each replication to better ensure that each replication will be start at the same place in the substreams, thereby, improving sychronization when using common random numbers.

        Setting it to true indicates that it does jump to the next substream, true is the default

    • Constructor Detail

      • RandomElement

        public RandomElement​(ModelElement parent,
                             java.util.List<T> elements,
                             double[] cdf)
        Parameters:
        parent -
      • RandomElement

        public RandomElement​(ModelElement parent,
                             java.util.List<T> elements,
                             double[] cdf,
                             java.lang.String name)
        Parameters:
        parent -
        name -
    • Method Detail

      • getResetStartStreamOption

        public final boolean getResetStartStreamOption()
        Gets the current Reset Start Stream Option
        Specified by:
        getResetStartStreamOption in interface StreamOptionIfc
        Returns:
      • setResetStartStreamOption

        public final void setResetStartStreamOption​(boolean b)
        Sets the reset start stream option, true means that it will be reset to the starting stream
        Specified by:
        setResetStartStreamOption in interface StreamOptionIfc
        Parameters:
        b -
      • getResetNextSubStreamOption

        public final boolean getResetNextSubStreamOption()
        Gets the current reset next substream option true means, that it is set to jump to the next substream after each replication
        Specified by:
        getResetNextSubStreamOption in interface StreamOptionIfc
        Returns:
      • setResetNextSubStreamOption

        public final void setResetNextSubStreamOption​(boolean b)
        Sets the current reset next substream option true means, that it is set to jump to the next substream after each replication
        Specified by:
        setResetNextSubStreamOption in interface StreamOptionIfc
        Parameters:
        b -
      • contains

        public final boolean contains​(java.lang.Object arg0)
        Parameters:
        arg0 -
        Returns:
        See Also:
        List.contains(java.lang.Object)
      • containsAll

        public final boolean containsAll​(java.util.Collection<?> arg0)
        Parameters:
        arg0 -
        Returns:
        See Also:
        List.containsAll(java.util.Collection)
      • indexOf

        public final int indexOf​(java.lang.Object arg0)
        Parameters:
        arg0 -
        Returns:
        See Also:
        List.indexOf(java.lang.Object)
      • isEmpty

        public final boolean isEmpty()
        Returns:
        See Also:
        List.isEmpty()
      • size

        public final int size()
        Returns:
        See Also:
        List.size()
      • getList

        public final java.util.List<T> getList()
        Returns an unmodifiable view of the list of elements
        Returns:
      • 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.
      • beforeExperiment

        protected void beforeExperiment()
        before any replications reset the underlying random number generator to the starting stream
        Overrides:
        beforeExperiment in class ModelElement
      • afterReplication

        protected void afterReplication()
        after each replication reset the underlying random number generator to the next substream
        Overrides:
        afterReplication in class ModelElement