public class PathManualTree extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PathManualTree.Node
Public class that contains all the attributes of the node that corresponds
to a Manual Tree (Different from a Heuristic Tree Node).
|
Modifier and Type | Field and Description |
---|---|
private PathManualTree.Node |
anchor |
private ArrayList<PathManualTree.Node> |
expansionOrder |
private GraphViz |
graphVizHelper |
private HashSet<PathManualTree.Node> |
visitedInExpanded |
private HashSet<PathManualTree.Node> |
visitedNodes |
Constructor and Description |
---|
PathManualTree(PathManualTree.Node anchor)
Initialize a graphViz tree with an initial node received by parameter,
which is the anchor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMovement(PathManualTree.Node child)
Create a step movement between father and child
|
void |
addNode(PathManualTree.Node father,
PathManualTree.Node child)
This method adds a child to the specified node.
|
void |
addNodeToInvalidNodes(PathManualTree.Node node)
this method adds a node to a list of inaccessible nodes
|
private void |
drawTree(PathManualTree.Node node)
We draw the tree node by node checking which nodes are the actual node's children.
|
void |
endTree()
We have to manually end the tree, again, so the nodes wont be displayed in
an incorrect order on the graphic implementation.
|
boolean |
exists(PathManualTree.Node child)
Method to check if the node already exist as a child, so we wont repeat nodes,
or even that we have the chance to change it to another father to correct the
flow of the tree.
|
String |
getDotTree()
Get the source for the tree creation from the GraphViz class.
|
void |
setFinal(PathManualTree.Node node)
Set a certain node as the final node for the graphical implementation.
|
void |
setInitial(PathManualTree.Node node)
Set a certain node as the initial node for the graphical implementation.
|
private PathManualTree.Node anchor
private GraphViz graphVizHelper
private HashSet<PathManualTree.Node> visitedNodes
private HashSet<PathManualTree.Node> visitedInExpanded
private ArrayList<PathManualTree.Node> expansionOrder
public PathManualTree(PathManualTree.Node anchor)
anchor
- initial node for the tree.public void addNodeToInvalidNodes(PathManualTree.Node node)
node
- node to set inaccessiblepublic void addNode(PathManualTree.Node father, PathManualTree.Node child)
father
- parent nodechild
- child nodepublic void addMovement(PathManualTree.Node child)
child
- final nodepublic boolean exists(PathManualTree.Node child)
child
- Child node to look for.public void endTree()
private void drawTree(PathManualTree.Node node)
node
- Father node to look for children.public String getDotTree()
public void setInitial(PathManualTree.Node node)
node
- The original node to initiate the graphic tree.public void setFinal(PathManualTree.Node node)
node
- The final node to get the graphic tree to an end.