Class RandomNumberGenerator

  • All Implemented Interfaces:
    AdditionalInformationHandler, ArrayProvider, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ArrayProvider, ErrorHandler, OutputProducer, Serializable, Comparable

    public class RandomNumberGenerator
    extends AbstractArrayProvider
    Random number generator. The type of random numbers depends on the chosen generator.

    Input/output:
    - generates:
       java.lang.Number


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: RandomNumberGenerator
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this 
        actor encounters an error; the error gets propagated; useful for critical 
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing 
        actor handler must have this enabled as well.
        default: false
     
    -output-array <boolean> (property: outputArray)
        If enabled, the random numbers are output as array rather than one by one.
        default: false
     
    -generator <adams.data.random.RandomNumberGenerator> (property: generator)
        The random number generator to use.
        default: adams.data.random.JavaRandomDouble
     
    -max-num <int> (property: maxNum)
        The maximum number of random numbers to generate; -1 means unlimited.
        default: 1000
        minimum: -1
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_MaxNum

        protected int m_MaxNum
        the maximum number of random numbers to generate.
    • Constructor Detail

      • RandomNumberGenerator

        public RandomNumberGenerator()
    • Method Detail

      • setGenerator

        public void setGenerator​(RandomNumberGenerator value)
        Sets the random number generator to use.
        Parameters:
        value - the generator
      • getGenerator

        public RandomNumberGenerator getGenerator()
        Returns the random number generator to use.
        Returns:
        the generator
      • generatorTipText

        public String generatorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMaxNum

        public void setMaxNum​(int value)
        Sets the maximum number of random numbers to generate.
        Parameters:
        value - the maximum number, -1 means unlimited
      • getMaxNum

        public int getMaxNum()
        Returns the maximum number of random numbers to generate.
        Returns:
        the maximum number, -1 means unlimited
      • maxNumTipText

        public String maxNumTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doExecute

        protected String doExecute()
        Does nothing.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message