Class ShotPoints.Tally
java.lang.Object
com.crossbotics.ftchelper.finders.ShotPoints.Tally
- Enclosing class:
ShotPoints
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 -
Method Summary
Modifier and TypeMethodDescriptiondouble[]best()The try with the best hit ratio: {speed RPM, hood degrees (NaN = no hood)}.doublebestRpm()The speed ofbest(), NaN if nothing went in yet.voidclear()Forgets everything (a new spot, a new table, or after saving).inthits(double rpm) Hits at this speed (no hood).inthits(double rpm, double hoodDeg) Hits at this speed and hood angle.booleanisEmpty()True if nothing is marked.voidmark(double rpm, boolean hit, double measuredRpm) One shot marked at this speed (no hood).voidmark(double rpm, double hoodDeg, boolean hit, double measuredRpm) One shot marked at this speed and hood angle.doublemeasuredRpm(double rpm) The average measured flywheel speed at this speed's shots (no hood), NaN if none was measured.doublemeasuredRpm(double rpm, double hoodDeg) The average measured flywheel speed at this speed and hood angle, NaN if none was measured.voidsetSpot(double distanceIn) Sets the spot (the distance when the first shot was marked).intshots(double rpm) Shots marked at this speed (no hood).intshots(double rpm, double hoodDeg) Shots marked at this speed and hood angle.doublespotIn()The distance where these shots were marked (inches), NaN before the first mark.summary()Every try here with its hits, e.g.intShots marked at every speed.inttries()How many different tries (speed, hood) are marked here.voidunmark(double rpm, double hoodDeg, boolean hit, double measuredRpm) Takes back one mark (an undo): the same numbers as themark(double, boolean, double)it undoes.
-
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), RPMhit- true if it went inmeasuredRpm- 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), RPMhoodDeg- the hood angle it was shot with, degrees (NaN = no hood)hit- true if it went inmeasuredRpm- 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 themark(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 ofbest(), NaN if nothing went in yet. -
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).
-