Class AStar<T>
java.lang.Object
com.inductiveautomation.ignition.designer.blockandconnector.routing.AStar<T>
A* algorithm implementation using the method design pattern.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionFind the shortest path to a goal starting fromstart.protected DoubleTotal cost function to reach the nodetofromfrom.protected abstract DoubleCost for the operation to go totofromfrom.generateSuccessors(T node) Generate the successors for a given node.getCost()Get the cost to reach the last node in the path.intCheck how many times a node was expanded.protected abstract DoubleEstimated cost to reach a goal node.protected abstract booleanCheck if the current node is a goal for the problem.
- 
Constructor Details- 
AStarpublic AStar()Default c'tor.
 
- 
- 
Method Details- 
isGoalCheck if the current node is a goal for the problem.- Parameters:
- node- The node to check.
- Returns:
- trueif it is a goal,- falseotherwise.
 
- 
gCost for the operation to go totofromfrom.- Parameters:
- from- The node we are leaving.
- to- The node we are reaching.
- Returns:
- The cost of the operation.
 
- 
hEstimated cost to reach a goal node. An admissible heuristic never gives a cost bigger than the real one.from.- Parameters:
- from- The node we are leaving.
- to- The node we are reaching.
- Returns:
- The estimated cost to reach an object.
 
- 
generateSuccessorsGenerate the successors for a given node.- Parameters:
- node- The node we want to expand.
- Returns:
- A list of possible next steps.
 
- 
getExpandedCounterpublic int getExpandedCounter()Check how many times a node was expanded.- Returns:
- A counter of how many times a node was expanded.
 
- 
fTotal cost function to reach the nodetofromfrom.The total cost is defined as: f(x) = g(x) + h(x). - Parameters:
- from- The node we are leaving.
- to- The node we are reaching.
- Returns:
- The total cost.
 
- 
getCostGet the cost to reach the last node in the path.- Returns:
- The cost for the found path.
 
- 
computeFind the shortest path to a goal starting fromstart.- Parameters:
- start- The initial node.
- Returns:
- A list of nodes from the initial point to a goal, nullif a path doesn't exist.
 
 
-