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 boolean
equals(Object obj)
ST
getArrivalConnection()
Replies the connection to reach the node.double
getCost()
Replies the cost to reach the node.double
getEstimatedCost()
Replies the cost from the node to the target point.PT
getGraphPoint()
Replies the graph point associated to this AStarNode.Iterable<ST>
getGraphSegments()
Replies the segments which are traversable from this node.double
getPathCost()
Replies the cost of the overall path.int
hashCode()
ST
setArrivalConnection(ST connection)
Set the connection to reach the node.double
setCost(double cost)
Set the cost to reach the node.double
setEstimatedCost(double cost)
Set the cost from the node to the target point.String
toString()
-
-
-
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:AStarNode
Replies the graph point associated to this AStarNode.- Specified by:
getGraphPoint
in 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:AStarNode
Replies the connection to reach the node.- Specified by:
getArrivalConnection
in interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Returns:
- the connection to reach the node, or
null
if none.
-
setArrivalConnection
public ST setArrivalConnection(ST connection)
Description copied from interface:AStarNode
Set the connection to reach the node.- Specified by:
setArrivalConnection
in 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
null
if none.
-
getCost
@Pure public double getCost()
Description copied from interface:AStarNode
Replies the cost to reach the node.- Specified by:
getCost
in 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:AStarNode
Set the cost to reach the node.- Specified by:
setCost
in 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:AStarNode
Replies the cost from the node to the target point.- Specified by:
getEstimatedCost
in 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:AStarNode
Set the cost from the node to the target point.- Specified by:
setEstimatedCost
in 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:AStarNode
Replies the cost of the overall path. It is the sum ofAStarNode.getCost()
andAStarNode.getEstimatedCost()
.- Specified by:
getPathCost
in 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:AStarNode
Replies the segments which are traversable from this node.- Specified by:
getGraphSegments
in interfaceAStarNode<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
- Returns:
- the traversable segments.
-
-