java.lang.Objectjrobots.utils.LinearPredictor
public final class LinearPredictor
The LinearPredictor is a helper class suited for linear extrapolation. It works with Scan values.
predict(Scan, Scan, double)
,
constructScan(Vector, double)
,
Serialized FormConstructor Summary | |
---|---|
protected |
LinearPredictor()
Do not instantiate |
Method Summary | |
---|---|
static Scan |
constructScan(Vector targetPosition,
double timeOfScan)
Constructs an artificial scan value for use in the LinearPredictor. |
static Vector |
predict(Scan scan1,
Scan scan2,
double time)
This method can be used to extrapolate the enemy's movement linearly. |
static Vector |
predict(SonarTrace trace1,
SonarTrace trace2,
double time)
This method can be used to extrapolate the enemy's movement linearly. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LinearPredictor()
Method Detail |
---|
public static Scan constructScan(Vector targetPosition, double timeOfScan)
You can use the returned values from the radar scanner directly in predict. Use this routine if you know exact positions you want to extrapolate from.
targetPosition
- - approximated target positiontimeOfScan
- - time at which the target was at the given position
public static Vector predict(Scan scan1, Scan scan2, double time)
The parameters scan1 and scan2 provide the two necessary vectors.
They contain a position (at least approximately) and a timestamp.
The third parameter specifies the target time of extrapolation (since begin of the encounter).
scan1
- a Scan which sighted the enemy (the order of scans is not relevant)scan2
- a Scan which sighted the same enemy (the order of scans is not relevant)time
- Where will the enemy be at that time? [s] (Time since the beginning of the match)
time
public static Vector predict(SonarTrace trace1, SonarTrace trace2, double time)
The parameters scan1 and scan2 provide the two necessary vectors.
They contain a position (at least approximately) and a timestamp.
The third parameter specifies the target time of extrapolation (since begin of the encounter).
trace1
- a Scan which sighted the enemy (the order of scans is not relevant)trace2
- a Scan which sighted the same enemy (the order of scans is not relevant)time
- Where will the enemy be at that absolute time? [s] (Time since the beginning of the match)
time