Class ProfileScorer


  • @Singleton
    public class ProfileScorer
    extends java.lang.Object
    Measures recorded and generated cursor movements, scores how natural they look, keeps per-category statistics and fits Fitts's law parameters.

    Profiles store summary statistics and a coarse 2D density grid instead of raw coordinates, which keeps each profile under about 25 KB on disk.

    • Constructor Detail

      • ProfileScorer

        public ProfileScorer()
    • Method Detail

      • recordTrajectory

        public ProfileScorer.TrajectoryMetrics recordTrajectory​(java.util.List<net.runelite.api.Point> points,
                                                                java.util.List<java.lang.Long> timestamps,
                                                                ProfileScorer.Context context,
                                                                int clickHoldMs,
                                                                java.awt.Rectangle targetBounds)
        Score and record a completed movement trajectory.
      • analyzeTrajectory

        public ProfileScorer.TrajectoryMetrics analyzeTrajectory​(java.util.List<net.runelite.api.Point> points,
                                                                 java.util.List<java.lang.Long> timestamps,
                                                                 int clickHoldMs,
                                                                 java.awt.Rectangle targetBounds)
        Compute trajectory metrics and a naturalness score.
      • adaptProfile

        public void adaptProfile​(MouseProfile profile)
        Perform linear regression on observed (Index of Difficulty, Movement Time) samples to update the Fitts coefficients of the given MouseProfile.
      • getOverallNaturalness

        public double getOverallNaturalness()
      • getTotalTrajectoriesScored

        public long getTotalTrajectoriesScored()
      • getSpatialHeatmap

        public int[][] getSpatialHeatmap()
      • getRecentVelocities

        public java.util.List<java.lang.Double> getRecentVelocities()
      • exportSummaryJson

        public java.lang.String exportSummaryJson​(java.lang.String profileName)
      • saveProfileData

        public void saveProfileData​(java.nio.file.Path dir,
                                    java.lang.String profileName)
                             throws java.io.IOException
        Throws:
        java.io.IOException