public final class LinearPredictor
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier | Constructor and Description |
---|---|
protected |
LinearPredictor()
Do not instantiate
|
Modifier and Type | Method and Description |
---|---|
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.
|
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 positionpublic 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