Class ReactionGenerator


  • public class ReactionGenerator
    extends java.lang.Object
    This class generates reaction times based on different distributions and provides static methods to retrieve reaction times for different scenarios.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getAFK()
      Returns the AFK (Away From Keyboard) time in milliseconds based on the next reaction time.
      static int getLowPredictable()
      Returns a low predictable value for reaction time based on the given parameters.
      static int getNormal()
      Returns a randomly generated reaction time within the normal distribution range.
      static int getPredictable()
      Returns a predictable reaction time based on the given inputs.
      static int nextReactionTime​(double mu, double sigma, double lambda, double p, double minimum, double maximum)
      Generates the next reaction time based on an exGaussian distribution with given parameters, or a uniform distribution if a random number is less than the given probability.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReactionGenerator

        public ReactionGenerator()
    • Method Detail

      • nextReactionTime

        public static int nextReactionTime​(double mu,
                                           double sigma,
                                           double lambda,
                                           double p,
                                           double minimum,
                                           double maximum)
        Generates the next reaction time based on an exGaussian distribution with given parameters, or a uniform distribution if a random number is less than the given probability.
        Parameters:
        mu - the mean of the exGaussian distribution
        sigma - the standard deviation of the exGaussian distribution
        lambda - the parameter controlling the exponential decay of the exGaussian distribution
        p - the probability of selecting from the uniform distribution
        minimum - the minimum value of the reaction time
        maximum - the maximum value of the reaction time
        Returns:
        the next generated reaction time
      • getLowPredictable

        public static int getLowPredictable()
        Returns a low predictable value for reaction time based on the given parameters.
        Returns:
        the low predictable value for reaction time
      • getPredictable

        public static int getPredictable()
        Returns a predictable reaction time based on the given inputs.
        Returns:
        the predictable reaction time
      • getNormal

        public static int getNormal()
        Returns a randomly generated reaction time within the normal distribution range.
        Returns:
        a randomly generated reaction time within the normal distribution range
      • getAFK

        public static int getAFK()
        Returns the AFK (Away From Keyboard) time in milliseconds based on the next reaction time.
        Returns:
        the AFK time in milliseconds