Class DefaultNoiseProvider

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultNoiseProvider​(double noisinessDivider)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DoublePoint getNoise​(java.util.Random random, double xStepSize, double yStepSize)
      Noise is offset from the original trajectory, simulating user and physical errors on mouse movement.
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_NOISINESS_DIVIDER

        public static final double DEFAULT_NOISINESS_DIVIDER
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultNoiseProvider

        public DefaultNoiseProvider​(double noisinessDivider)
        Parameters:
        noisinessDivider - bigger value means less noise.
    • Method Detail

      • getNoise

        public DoublePoint getNoise​(java.util.Random random,
                                    double xStepSize,
                                    double yStepSize)
        Description copied from interface: NoiseProvider
        Noise is offset from the original trajectory, simulating user and physical errors on mouse movement.

        Noise is accumulating, so on average it should create an equal chance of either positive or negative movement on each axis, otherwise the mouse movement will always be slightly offset to single direction.

        Deviation from DeviationProvider is different from the Noise because it works like a mathematical function and is not accumulating.

        Not every step needs to add noise, use randomness to only add noise sometimes, otherwise return Point(0, 0).

        During the final steps of mouse movement, the effect of noise is gradually reduced, so the mouse would finish on the intended pixel smoothly, thus the implementation of this class can safely ignore and not know the beginning and end of the movement.

        Specified by:
        getNoise in interface NoiseProvider
        Parameters:
        random - use this to generate randomness in the offset
        xStepSize - the step size that is taken horizontally
        yStepSize - the step size that is taken vertically
        Returns:
        a point which describes how much the mouse offset is increased or decreased this step. This value must not include the parameters xStepSize and yStepSize. For no change in noise just return (0,0).