Package net.openosrs.api.input.motion
Class ProfileScorer
- java.lang.Object
-
- net.openosrs.api.input.motion.ProfileScorer
-
@Singleton public class ProfileScorer extends java.lang.ObjectMeasures 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProfileScorer.CategoryStatsstatic classProfileScorer.Contextstatic classProfileScorer.ProfileSummaryCompact serializable summary representation (< 25 KB).static classProfileScorer.TrajectoryMetricsRepresents an analyzed trajectory segment.
-
Field Summary
Fields Modifier and Type Field Description static intHEATMAP_COLSstatic intHEATMAP_ROWS
-
Constructor Summary
Constructors Constructor Description ProfileScorer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadaptProfile(MouseProfile profile)Perform linear regression on observed (Index of Difficulty, Movement Time) samples to update the Fitts coefficients of the given MouseProfile.ProfileScorer.TrajectoryMetricsanalyzeTrajectory(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.java.lang.StringexportSummaryJson(java.lang.String profileName)java.util.Map<ProfileScorer.Context,ProfileScorer.CategoryStats>getAllCategoryMetrics()ProfileScorer.CategoryStatsgetCategoryStats(ProfileScorer.Context ctx)doublegetOverallNaturalness()java.util.List<java.lang.Double>getRecentVelocities()int[][]getSpatialHeatmap()longgetTotalTrajectoriesScored()ProfileScorer.TrajectoryMetricsrecordTrajectory(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.voidsaveProfileData(java.nio.file.Path dir, java.lang.String profileName)
-
-
-
Field Detail
-
HEATMAP_COLS
public static final int HEATMAP_COLS
- See Also:
- Constant Field Values
-
HEATMAP_ROWS
public static final int HEATMAP_ROWS
- See Also:
- Constant Field Values
-
-
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()
-
getCategoryStats
public ProfileScorer.CategoryStats getCategoryStats(ProfileScorer.Context ctx)
-
getAllCategoryMetrics
public java.util.Map<ProfileScorer.Context,ProfileScorer.CategoryStats> getAllCategoryMetrics()
-
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
-
-