Class FakeEvaluator

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.Randomizable, adams.core.ShallowCopySupporter<Evaluator>, adams.core.SizeOfHandler, Evaluator, Serializable, Comparable

    public class FakeEvaluator
    extends AbstractEvaluator
    implements adams.core.Randomizable
    Fake evaluator, outputs random values based on min/max values.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -missing-evaluation <float> (property: missingEvaluation)
        The value to use as replacement for missing evaluations.
        default: NaN
     
    -build-wait <int> (property: buildWait)
        The time in msec to wait when calling 'performBuild'.
        default: 0
        minimum: 0
     
    -eval-wait <int> (property: evalWait)
        The time in msec to wait when calling 'performEvaluate'.
        default: 0
        minimum: 0
     
    -eval-min <float> (property: evalMin)
        The minimum value to output.
        default: 0.0
     
    -eval-max <float> (property: evalMax)
        The maximum value to output.
        default: 1.0
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Seed

        protected long m_Seed
        the seed.
      • m_BuildWait

        protected int m_BuildWait
        the build wait time in msec.
      • m_EvalWait

        protected int m_EvalWait
        the eval wait time in msec.
      • m_EvalMin

        protected float m_EvalMin
        the minimum to use for the evaluations.
      • m_EvalMax

        protected float m_EvalMax
        the maximum to use for the evaluations.
      • m_Random

        protected Random m_Random
        for generating the random numbers.
    • Constructor Detail

      • FakeEvaluator

        public FakeEvaluator()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractEvaluator
      • setSeed

        public void setSeed​(long value)
        Sets the seed value for the random values.
        Specified by:
        setSeed in interface adams.core.Randomizable
        Parameters:
        value - the seed
      • getSeed

        public long getSeed()
        Returns the seed value for the random values.
        Specified by:
        getSeed in interface adams.core.Randomizable
        Returns:
        the seed
      • seedTipText

        public String seedTipText()
        Returns the tip text for this property.
        Specified by:
        seedTipText in interface adams.core.Randomizable
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setBuildWait

        public void setBuildWait​(int value)
        Sets the time in msec to wait when calling buildClassifier.
        Parameters:
        value - the time in msec
      • getBuildWait

        public int getBuildWait()
        Returns the time in msec to wait when calling buildClassifier.
        Returns:
        the time in msec
      • buildWaitTipText

        public String buildWaitTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setEvalWait

        public void setEvalWait​(int value)
        Sets the time in msec to wait when calling classifyInstance.
        Parameters:
        value - the time in msec
      • getEvalWait

        public int getEvalWait()
        Returns the time in msec to wait when calling classifyInstance.
        Returns:
        the time in msec
      • evalWaitTipText

        public String evalWaitTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setEvalMin

        public void setEvalMin​(float value)
        Sets the minimum value to output.
        Parameters:
        value - the minimum value
      • getEvalMin

        public float getEvalMin()
        Returns the minimum value to output.
        Returns:
        the minimum value
      • evalMinTipText

        public String evalMinTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setEvalMax

        public void setEvalMax​(float value)
        Sets the maximum value to output.
        Parameters:
        value - the maximum value
      • getEvalMax

        public float getEvalMax()
        Returns the maximum value to output.
        Returns:
        the maximum value
      • evalMaxTipText

        public String evalMaxTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • getDefaultMissingEvaluation

        protected float getDefaultMissingEvaluation()
        Returns the default value in case of missing evaluations.
        Specified by:
        getDefaultMissingEvaluation in class AbstractEvaluator
        Returns:
        the default value
      • wait

        protected void wait​(int msec)
        Waits for a specified amount of time.
        Parameters:
        msec - the time in msec to wait
      • getRandom

        protected Random getRandom()
        Returns the random number generator to use.
        Returns:
        the random number generator
      • performEvaluate

        protected Float performEvaluate​(weka.core.Instance data)
        Performs the actual evaluation.
        Overrides:
        performEvaluate in class AbstractEvaluator
        Parameters:
        data - the instance to check
        Returns:
        always 1.0
      • performBuild

        protected boolean performBuild​(weka.core.Instances data)
        Builds the evaluator.
        Specified by:
        performBuild in class AbstractEvaluator
        Parameters:
        data - the instance to check
        Returns:
        false if min/max are invalid
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface adams.core.CleanUpHandler