|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.deepthought.sidious.planner.graph.AStarGraph
public final class AStarGraph
Represents a graph for use with the A-Star algorithm.
Field Summary | |
---|---|
private Vertex |
goalVertex
The goal vertex of this. |
private Heuristic |
heuristic
The heuristic to be used with this. |
private static org.apache.commons.logging.Log |
logger
The logger of this class. |
private SuperLinkID |
requesterId
The id of the requester. |
private RuleEngine |
ruleEngine
Cached instance of the rule engine. |
private Vertex |
sourceVertex
The source vertex of this. |
private java.util.List<Vertex> |
vertices
The vertices of this. |
Constructor Summary | |
---|---|
AStarGraph(State sourceState,
State goalState,
java.util.Collection<Adjustable> adjustables,
Heuristic heuristic,
SuperLinkID requester)
Constructs an AStarGraph with a start and end-state, and
the set adjustables. |
Method Summary | |
---|---|
(package private) double |
calculateCost(State current,
State next,
Step step)
Method returns the calculated cost of getting from current
to next . |
java.util.Collection<Edge> |
getEdges(Vertex v)
This method retrieves the edges emanating from the Vertex
v. |
Vertex |
getGoalVertex()
Gets the goal Vertex of this Graph . |
SuperLinkID |
getId()
Returns the id of the owner/requester for this graph. |
Vertex |
getSourceVertex()
Gets the source Vertex of this Graph . |
(package private) Vertex |
getVertexFromState(State state)
This method checks if the state is represented by a
Vertex in the graph, and returns either the representing
vertex or a new vertex, which is added to the graph. |
void |
setApproximateGoal(Vertex v)
Method sets the goalVertex to this vertex if all the goal state descriptors are contained in the input vertex. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log logger
private final java.util.List<Vertex> vertices
private final Vertex sourceVertex
private Vertex goalVertex
private final Heuristic heuristic
private final SuperLinkID requesterId
private final RuleEngine ruleEngine
Constructor Detail |
---|
public AStarGraph(State sourceState, State goalState, java.util.Collection<Adjustable> adjustables, Heuristic heuristic, SuperLinkID requester)
AStarGraph
with a start and end-state, and
the set adjustables.
sourceState
- the beginning state of any pathgoalState
- the end state of any pathadjustables
- the adjustables of the current requesterheuristic
- the heuristic of the graphrequester
- the id of the plan requesterMethod Detail |
---|
public java.util.Collection<Edge> getEdges(Vertex v)
Vertex
v. It does this by calculating the edges and vertices on-the-fly.
getEdges
in interface Graph
v
- the starting Vertex
Vertex
Graph.getEdges(dk.deepthought.sidious.planner.graph.Vertex)
double calculateCost(State current, State next, Step step)
current
to next
.
current
- the current statenext
- the next statestep
- the step
Vertex getVertexFromState(State state)
state
is represented by a
Vertex
in the graph, and returns either the representing
vertex or a new vertex, which is added to the graph.
state
- the state
public Vertex getGoalVertex()
Graph
Vertex
of this Graph
. The
goal vertex is defined as the ending point of any path in this graph.
The implementing graph class must guarantee that any
preconditions for the goal vertex of the Pathfinder
are
not violated.
getGoalVertex
in interface Graph
public Vertex getSourceVertex()
Graph
Vertex
of this Graph
. The
source vertex is defined as the starting point of any path in this graph.
The implementing graph class must guarantee that any
preconditions for the source vertex of the Pathfinder
are
not violated.
getSourceVertex
in interface Graph
public SuperLinkID getId()
Graph
getId
in interface Graph
public java.lang.String toString()
toString
in class java.lang.Object
public void setApproximateGoal(Vertex v)
Graph
setApproximateGoal
in interface Graph
v
- the approximate goal candidate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |