Class ShotPoints.Tally

java.lang.Object
com.crossbotics.ftchelper.finders.ShotPoints.Tally
Enclosing class:
ShotPoints

public static final class ShotPoints.Tally extends Object
Hits and shots at each speed (and hood angle) tried at ONE spot, the way teams tune: shoot 3-5 at a speed, mark each HIT or MISS, try the next speed, and keep the speed with the best hit ratio (hits / shots: 3 in out of 4 = 3/4). With a hood, each speed AND hood angle is its own try, so the winner is saved with the hood it was really shot with.

 ShotPoints.Tally tally = new ShotPoints.Tally();
 tally.mark(2500, true, 2490);    // a hit at 2500 RPM (the flywheel measured 2490)
 tally.mark(2500, false, 2480);   // a miss
 tally.bestRpm();                 // 2500 (1 of 2)
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    The try with the best hit ratio: {speed RPM, hood degrees (NaN = no hood)}.
    double
    The speed of best(), NaN if nothing went in yet.
    void
    Forgets everything (a new spot, a new table, or after saving).
    int
    hits(double rpm)
    Hits at this speed (no hood).
    int
    hits(double rpm, double hoodDeg)
    Hits at this speed and hood angle.
    boolean
    True if nothing is marked.
    void
    mark(double rpm, boolean hit, double measuredRpm)
    One shot marked at this speed (no hood).
    void
    mark(double rpm, double hoodDeg, boolean hit, double measuredRpm)
    One shot marked at this speed and hood angle.
    double
    measuredRpm(double rpm)
    The average measured flywheel speed at this speed's shots (no hood), NaN if none was measured.
    double
    measuredRpm(double rpm, double hoodDeg)
    The average measured flywheel speed at this speed and hood angle, NaN if none was measured.
    void
    setSpot(double distanceIn)
    Sets the spot (the distance when the first shot was marked).
    int
    shots(double rpm)
    Shots marked at this speed (no hood).
    int
    shots(double rpm, double hoodDeg)
    Shots marked at this speed and hood angle.
    double
    The distance where these shots were marked (inches), NaN before the first mark.
    Every try here with its hits, e.g.
    int
    Shots marked at every speed.
    int
    How many different tries (speed, hood) are marked here.
    void
    unmark(double rpm, double hoodDeg, boolean hit, double measuredRpm)
    Takes back one mark (an undo): the same numbers as the mark(double, boolean, double) it undoes.

    Methods inherited from class java.lang.Object

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

    • Tally

      public Tally()
  • Method Details

    • mark

      public void mark(double rpm, boolean hit, double measuredRpm)
      One shot marked at this speed (no hood).
      Parameters:
      rpm - the speed asked for (setpoint), RPM
      hit - true if it went in
      measuredRpm - the flywheel speed measured at that shot, NaN if not known
    • mark

      public void mark(double rpm, double hoodDeg, boolean hit, double measuredRpm)
      One shot marked at this speed and hood angle.
      Parameters:
      rpm - the speed asked for (setpoint), RPM
      hoodDeg - the hood angle it was shot with, degrees (NaN = no hood)
      hit - true if it went in
      measuredRpm - the flywheel speed measured at that shot, NaN if not known
    • unmark

      public void unmark(double rpm, double hoodDeg, boolean hit, double measuredRpm)
      Takes back one mark (an undo): the same numbers as the mark(double, boolean, double) it undoes. A try left with no shots is forgotten; with nothing marked at all, the spot is too.
    • hits

      public int hits(double rpm)
      Hits at this speed (no hood).
    • hits

      public int hits(double rpm, double hoodDeg)
      Hits at this speed and hood angle.
    • shots

      public int shots(double rpm)
      Shots marked at this speed (no hood).
    • shots

      public int shots(double rpm, double hoodDeg)
      Shots marked at this speed and hood angle.
    • totalShots

      public int totalShots()
      Shots marked at every speed.
    • measuredRpm

      public double measuredRpm(double rpm)
      The average measured flywheel speed at this speed's shots (no hood), NaN if none was measured.
    • measuredRpm

      public double measuredRpm(double rpm, double hoodDeg)
      The average measured flywheel speed at this speed and hood angle, NaN if none was measured.
    • best

      public double[] best()
      The try with the best hit ratio: {speed RPM, hood degrees (NaN = no hood)}. A tie: the one with more shots (surer), then the lower speed. null if nothing went in yet.
    • bestRpm

      public double bestRpm()
      The speed of best(), NaN if nothing went in yet.
    • summary

      public String summary()
      Every try here with its hits, e.g. "2450: 1/3, 2550: 3/4 (best)", with a hood "2550 @ 12.5 deg: 3/4 (best)"; "" if none.
    • tries

      public int tries()
      How many different tries (speed, hood) are marked here.
    • spotIn

      public double spotIn()
      The distance where these shots were marked (inches), NaN before the first mark.
    • setSpot

      public void setSpot(double distanceIn)
      Sets the spot (the distance when the first shot was marked).
    • isEmpty

      public boolean isEmpty()
      True if nothing is marked.
    • clear

      public void clear()
      Forgets everything (a new spot, a new table, or after saving).