|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfaa.tg.ground.GroundFixConnection
public class GroundFixConnection
A GroundFixConnection is one-way. It's possible to do a two- way connection, but this allows us more flexibility in applying penalties. For example, going from A -> B could have a certain cost, but B -> A could cost more (i.e., it is frowned upon). A possible downside (or upside, depending on how you view it) is that this class only cares about the destination. Thus, multiple nodes could use this connection to connect to a single destination node. Another possible use is making one-way paths. For connections where the cost is determined by the constructor, the value is equal to the distance of the path in feet.
| Field Summary | |
|---|---|
private double |
a0
|
private double |
a1
|
private double |
a1Xa1
|
private double |
a1Xa2
|
private double |
a2
|
private double |
a2_2
|
private double |
a3
|
private double |
a3_3
|
private double |
a3_6
|
private double |
angleDiff
|
private double |
b0
|
private double |
b1
|
private double |
b1Xb1
|
private double |
b1Xb2
|
private double |
b2
|
private double |
b2_2
|
private double |
b3
|
private double |
b3_3
|
private double |
b3_6
|
private double |
coeff3
|
private double |
coeff4
|
private double |
coeff5
|
private Position |
control1
|
private Position |
control2
|
private static double |
CURVATURE_CONST
|
static java.lang.String |
CVS_VERSION_ID
The CVS Version ID. |
private Point |
end
|
private TurnDirection |
endDirection
|
private GroundFixState |
endState
|
private static int |
MAX_GENERATION
|
private double |
mCost
|
private boolean |
mCurved
|
private GroundFix |
mDest
|
private TrueHeading |
mEndHeading
|
private Distance |
mLength
|
private GroundFix |
mOrig
|
private TrueHeading |
mStartHeading
|
private static double |
newtonCotes8DivisorA
|
private static double |
newtonCotes8DivisorB
|
private PolygonalPath |
path
|
(package private) static long |
serialVersionUID
|
private Point |
start
|
private GroundFixState |
startState
|
| Constructor Summary | |
|---|---|
protected |
GroundFixConnection(GroundFix aFirst,
GroundFix aSecond,
Locale locale)
Constructs a GroundFixConnection with aSecond as the destination and the cost of traversing the segment as the distance between the two GroundFixs. |
protected |
GroundFixConnection(GroundFix origin,
GroundFix destination,
Position control1,
Position control2,
Locale locale)
Construct a GroundFixConnection with aSecond as the destination. |
| Method Summary | |
|---|---|
protected double |
arcAngularChange()
|
private double |
arcLength(double aInitialT,
double aFinalT)
Uses Newton-Cotes to approximate the integral |
private double |
calcAngleDiff(double t)
|
double |
calcArcDiffEval(double t)
|
private double |
calculateArcIntegral(double aInitialT,
double aFinalT)
|
Distance |
calculateArcLength(double aInitialT,
double aFinalT)
|
double |
calculateCurvature(double t)
|
Distance |
calculateRemainingArcLength(double aT)
|
boolean |
endDirectionCompatibleWith(TurnDirection dir)
|
(package private) boolean |
endsSimilarly(GroundFixConnection gfc)
|
Coordinate |
findClosestCoordinate(Point p)
Finds the closest Coordinate on the curve to the argument. |
Point |
findClosestPoint(Point p)
|
protected double |
findClosestValue(double NX,
double NY)
Will find the closest point to the connection(Bezier curve) (more numerically stable than the TVal version) |
double |
findClosestValue(Point p)
Will find the closest point to the connection(Bezier curve) (more numerically stable than the TVal version) |
double |
findDistSq(double NX,
double NY,
double Tval)
Finds the distance squared of the point (NX,NY) to the point on the curve at the parametric value Tval |
GroundFixState |
findEndState()
|
double |
findHighestCurvatureLocation()
Uses Sturm's method to solve a polynomial to find the (a) parametric value of largest curvature in [0,1] |
java.util.Set<java.lang.Double> |
findIntersections(LineSegment seg,
double start)
Takes a LineSegment and returns the first intersection found as a parametric value. |
protected double |
findLineIntersection(double A1,
double A0,
double B1,
double B0)
Takes a line in the parametric form Y = B1 * t + B0 and X = A1 * t + A0 and returns the first intersection found as a parametric value. |
GroundFixState |
findStartState()
|
PolygonalPath |
generatePolygonalPath(double t)
Generates a PolygonalPath starting at the parametric argument. |
PolygonalPath |
generatePolygonalPath(double t,
double t2)
Generates a PolygonalPath in the parametric range [t,t2] on the connection. |
Position |
getControl1()
|
Position |
getControl2()
|
Coordinate |
getCoordinate(double t)
This method can return a Coordinate for a specific t-value on the Bezier spline defined by this connection. |
double |
getCost()
Gets the cost associated with traversing this GroundFixConnection |
GroundFix |
getDestination()
Gets the GroundFix that is the destination of this segment |
TrueHeading |
getEndHeading()
Returns the heading at the end of the connection |
Point |
getEndingPoint()
|
Distance |
getLength()
Returns the length of this connection. |
java.lang.String |
getName()
Represents a unique instance of a class: objects should either be the only object of a class with that name, or should replace obsolete objects of that name. |
GroundFix |
getOrigin()
Gets the GroundFix that is the origin of this connection |
Point |
getPoint(double t)
This method can return a Point2D for a specific t-value on the Bezier spline defined by this connection. |
PolygonalPath |
getPolygonalPath()
|
GroundFixConnection |
getReciprocal()
Returns the reciprocal connection of this one, if it exists. |
TrueHeading |
getStartHeading()
Returns the heading at the start of the connection. |
Point |
getStartingPoint()
|
boolean |
hasReciprocal()
Returns whether this connection has a reciprocal connection. |
private static double |
intPow(double a,
int b)
returns a^b power where b is an int in the range [1,3] |
boolean |
isCurved()
Returns whether the segment is curved. |
boolean |
isCurved(double t)
|
double |
maximum()
|
double |
minimum()
|
double |
projectAhead(Distance aDist,
double aT)
Returns the parametric value on the curve that is aDist forward from aT. |
Point |
projectionFromStart(Distance aDist)
Returns the point whose path distance is the aDist from the origin. |
protected void |
setEndState(GroundFixState gfs)
Sets the end state to the input. |
protected void |
setStartState(GroundFixState gfs)
Sets the start state to the input. |
private int |
solutionFinder(SturmNode father,
java.util.ArrayList<java.lang.Double> solvec,
java.util.ArrayList<SturmPoly> remainders,
SturmPoly derivDist)
|
java.lang.String |
toDraText()
Returns text for drat Required by TextWritable interface |
java.lang.String |
toString()
Returns a String representation of the object |
private java.util.ArrayList<Point> |
tracePolyPoints(double startVal,
double endVal,
double degrees)
Finds the sequence points of this GroundFixConnection in the range [startVal,endVal] such that for a sequence S of size n, for all a_i, i not n, in S, |phi(a_i) - phi(a_i+1)| = degree, where phi(p) is the heading of the groundFixConnection at the parametric value p, and a_1 = startVal and a_n = endVal. |
boolean |
validateParameter(double t)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final long serialVersionUID
public static final java.lang.String CVS_VERSION_ID
private static final double CURVATURE_CONST
private final GroundFix mOrig
private final GroundFix mDest
private final Position control1
private final Position control2
private final double mCost
private final Distance mLength
private final boolean mCurved
private final double a1
private final double a2
private final double a3
private final double b1
private final double b2
private final double b3
private final double a0
private final double b0
private final double coeff3
private final double coeff4
private final double coeff5
private final double a2_2
private final double b2_2
private final double a3_3
private final double b3_3
private final double b3_6
private final double a3_6
private final double a1Xa2
private final double b1Xb2
private final double b1Xb1
private final double a1Xa1
private final TrueHeading mStartHeading
private final TrueHeading mEndHeading
private final transient PolygonalPath path
private final transient Point start
private final transient Point end
private final double angleDiff
private final transient TurnDirection endDirection
private static final double newtonCotes8DivisorA
private static final double newtonCotes8DivisorB
private static final int MAX_GENERATION
private transient GroundFixState startState
private transient GroundFixState endState
| Constructor Detail |
|---|
protected GroundFixConnection(GroundFix aFirst,
GroundFix aSecond,
Locale locale)
aFirst - the originaSecond - the destination
protected GroundFixConnection(GroundFix origin,
GroundFix destination,
Position control1,
Position control2,
Locale locale)
origin - the origindestination - the destinationcontrol1 - the first control pointcontrol2 - the second control point| Method Detail |
|---|
public java.lang.String getName()
ManagedObject
getName in interface ManagedObjectpublic double getCost()
public Distance getLength()
getLength in interface ParameterizedCurvepublic GroundFix getOrigin()
public GroundFix getDestination()
public Position getControl1()
public Position getControl2()
public boolean isCurved()
public boolean isCurved(double t)
public double calculateCurvature(double t)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toDraText()
toDraText in interface TextWritableprotected double arcAngularChange()
public double findHighestCurvatureLocation()
public Coordinate getCoordinate(double t)
t - the t-value, must be between zero and one
public Point getPoint(double t)
getPoint in interface ParameterizedCurvet - the t-value, must be between zero and one
public TrueHeading getStartHeading()
public TrueHeading getEndHeading()
public boolean hasReciprocal()
public GroundFixConnection getReciprocal()
public Distance calculateArcLength(double aInitialT,
double aFinalT)
calculateArcLength in interface ParameterizedCurve
private double arcLength(double aInitialT,
double aFinalT)
private double calculateArcIntegral(double aInitialT,
double aFinalT)
private double calcAngleDiff(double t)
public Distance calculateRemainingArcLength(double aT)
calculateRemainingArcLength in interface ParameterizedCurvepublic final double calcArcDiffEval(double t)
public double findClosestValue(Point p)
findClosestValue in interface ParameterizedCurvep - the point to find the nearest point of on the curve.
public Point findClosestPoint(Point p)
findClosestPoint in interface ParameterizedCurve
protected double findClosestValue(double NX,
double NY)
NX - x coord in meters from point defined for this.projNY - y coord in meters from point defined for this.proj
public double findDistSq(double NX,
double NY,
double Tval)
NX - the X valueNY - the Y valueTval - the parametric location of the other point.
private int solutionFinder(SturmNode father,
java.util.ArrayList<java.lang.Double> solvec,
java.util.ArrayList<SturmPoly> remainders,
SturmPoly derivDist)
public double projectAhead(Distance aDist,
double aT)
projectAhead in interface ParameterizedCurveDistance - aDist the distance forward to examinedouble - aT the starting parametric valuepublic Point projectionFromStart(Distance aDist)
aDist -
private static double intPow(double a,
int b)
protected double findLineIntersection(double A1,
double A0,
double B1,
double B0)
A1 - the x-slopeA0 - the x-offsetB1 - the y-slopeB0 - the y-offset
public java.util.Set<java.lang.Double> findIntersections(LineSegment seg,
double start)
findIntersections in interface ParameterizedCurveseg - the line segment to test.
private java.util.ArrayList<Point> tracePolyPoints(double startVal,
double endVal,
double degrees)
startVal - parametric starting valueendVal - parametric ending valuedegrees - is chosen angular difference
public PolygonalPath generatePolygonalPath(double t)
t - parametric value of the starting point.
public PolygonalPath generatePolygonalPath(double t,
double t2)
t - starting parametric value.t2 - ending parametric value.
public Coordinate findClosestCoordinate(Point p)
p - the point to check.
public PolygonalPath getPolygonalPath()
getPolygonalPath in interface ParameterizedCurvepublic Point getStartingPoint()
getStartingPoint in interface ParameterizedCurvepublic Point getEndingPoint()
getEndingPoint in interface ParameterizedCurvepublic GroundFixState findEndState()
public GroundFixState findStartState()
protected void setStartState(GroundFixState gfs)
gfs - the new start state.protected void setEndState(GroundFixState gfs)
gfs - the new end state.public boolean endDirectionCompatibleWith(TurnDirection dir)
dir - the direction to check
boolean endsSimilarly(GroundFixConnection gfc)
public double maximum()
maximum in interface ParameterizedCurvepublic double minimum()
minimum in interface ParameterizedCurvepublic boolean validateParameter(double t)
validateParameter in interface ParameterizedCurve
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||