Package org.arakhne.afc.math.graph.astar
Class AStar.Candidate
- java.lang.Object
-
- org.arakhne.afc.math.graph.astar.AStar.Candidate
-
- All Implemented Interfaces:
AStarNode<ST,PT>
- Enclosing class:
- AStar<GP extends GraphPath<GP,ST,PT>,ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
protected class AStar.Candidate extends Object implements AStarNode<ST,PT>
Candidate node in the A* algorithm, and its related information.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:42
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgraph
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)STgetArrivalConnection()Replies the connection to reach the node.doublegetCost()Replies the cost to reach the node.doublegetEstimatedCost()Replies the cost from the node to the target point.PTgetGraphPoint()Replies the graph point associated to this AStarNode.Iterable<ST>getGraphSegments()Replies the segments which are traversable from this node.doublegetPathCost()Replies the cost of the overall path.inthashCode()STsetArrivalConnection(ST connection)Set the connection to reach the node.doublesetCost(double cost)Set the cost to reach the node.doublesetEstimatedCost(double cost)Set the cost from the node to the target point.StringtoString()
-
-
-
Constructor Detail
-
Candidate
public Candidate(ST segment, PT entryPoint, double costToReach, double estimatedCost)
Construct a candidate.- Parameters:
segment- the segmententryPoint- the entry point.costToReach- the cost to reach the entry point.estimatedCost- the estimated cost between the entry point and the target point.
-
-
Method Detail
-
getGraphPoint
@Pure public PT getGraphPoint()
Description copied from interface:AStarNodeReplies the graph point associated to this AStarNode.- Specified by:
getGraphPointin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
- the graph point associated to this AStarNode.
-
getArrivalConnection
@Pure public ST getArrivalConnection()
Description copied from interface:AStarNodeReplies the connection to reach the node.- Specified by:
getArrivalConnectionin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
- the connection to reach the node, or
nullif none.
-
setArrivalConnection
public ST setArrivalConnection(ST connection)
Description copied from interface:AStarNodeSet the connection to reach the node.- Specified by:
setArrivalConnectionin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Parameters:
connection- is the new arrival connection.- Returns:
- the connection to reach the node, or
nullif none.
-
getCost
@Pure public double getCost()
Description copied from interface:AStarNodeReplies the cost to reach the node.- Specified by:
getCostin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
- the cost to reach the node.
-
setCost
public double setCost(double cost)
Description copied from interface:AStarNodeSet the cost to reach the node.- Specified by:
setCostin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Parameters:
cost- is the new cost.- Returns:
- the cost to reach the node.
-
getEstimatedCost
@Pure public double getEstimatedCost()
Description copied from interface:AStarNodeReplies the cost from the node to the target point.- Specified by:
getEstimatedCostin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
- the cost from the node to the target point.
-
setEstimatedCost
public double setEstimatedCost(double cost)
Description copied from interface:AStarNodeSet the cost from the node to the target point.- Specified by:
setEstimatedCostin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Parameters:
cost- is the new estimated cost.- Returns:
- the cost from the node to the target point.
-
getPathCost
@Pure public double getPathCost()
Description copied from interface:AStarNodeReplies the cost of the overall path. It is the sum ofAStarNode.getCost()andAStarNode.getEstimatedCost().- Specified by:
getPathCostin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
- the cost of the path.
-
getGraphSegments
@Pure public Iterable<ST> getGraphSegments()
Description copied from interface:AStarNodeReplies the segments which are traversable from this node.- Specified by:
getGraphSegmentsin interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>- Returns:
- the traversable segments.
-
-