edu.umich.visualsoar.graph
Class DirectedGraphAsAdjacencyLists
java.lang.Object
|
+--edu.umich.visualsoar.graph.Graph
|
+--edu.umich.visualsoar.graph.DirectedGraph
|
+--edu.umich.visualsoar.graph.DirectedGraphAsAdjacencyLists
- Direct Known Subclasses:
- OrderedDirectedGraphAsAdjacencyLists
- public class DirectedGraphAsAdjacencyLists
- extends DirectedGraph
This class is an implementation of the DirectedGraph class, using Adjacency Lists
it is based on Object-Oriented Design patterns in C++, later converted to Java
Method Summary |
void |
addEdge(edu.umich.visualsoar.graph.Edge e)
|
void |
addVertex(edu.umich.visualsoar.graph.Vertex v)
Adds a vertex to the graph |
java.util.Enumeration |
edges()
|
java.util.Enumeration |
emanatingEdges(edu.umich.visualsoar.graph.Vertex v)
|
java.util.Enumeration |
incidentEdges(edu.umich.visualsoar.graph.Vertex v)
|
boolean |
isEdge(int v0,
int v1)
If you have two vertices, tests whether there is an
edge between them, if there is return true otherwise
false |
void |
reduce(java.util.List listOfStartVertices)
This function finds all vertices that are unreachable from a state
and adds them to a list of holes so that they can be recycled for later
use |
void |
removeEdge(edu.umich.visualsoar.graph.Edge e)
|
void |
resolve()
|
edu.umich.visualsoar.graph.Edge |
selectEdge(int v0,
int v1)
If you have two vertices, get the edge between them
if the edge exists in the graph it returns that edge
otherwise it returns null |
edu.umich.visualsoar.graph.Vertex |
selectVertex(int id)
|
java.util.Enumeration |
vertices()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
vertices
protected java.util.Vector vertices
adjacencyLists
protected java.util.Vector adjacencyLists
DirectedGraphAsAdjacencyLists
public DirectedGraphAsAdjacencyLists()
addVertex
public void addVertex(edu.umich.visualsoar.graph.Vertex v)
- Description copied from class:
Graph
- Adds a vertex to the graph
- Specified by:
addVertex
in class Graph
selectVertex
public edu.umich.visualsoar.graph.Vertex selectVertex(int id)
- Specified by:
selectVertex
in class Graph
addEdge
public void addEdge(edu.umich.visualsoar.graph.Edge e)
- Specified by:
addEdge
in class Graph
removeEdge
public void removeEdge(edu.umich.visualsoar.graph.Edge e)
- Specified by:
removeEdge
in class Graph
selectEdge
public edu.umich.visualsoar.graph.Edge selectEdge(int v0,
int v1)
- Description copied from class:
Graph
- If you have two vertices, get the edge between them
if the edge exists in the graph it returns that edge
otherwise it returns null
- Specified by:
selectEdge
in class Graph
isEdge
public boolean isEdge(int v0,
int v1)
- Description copied from class:
Graph
- If you have two vertices, tests whether there is an
edge between them, if there is return true otherwise
false
- Specified by:
isEdge
in class Graph
vertices
public java.util.Enumeration vertices()
- Specified by:
vertices
in class Graph
edges
public java.util.Enumeration edges()
- Specified by:
edges
in class Graph
emanatingEdges
public java.util.Enumeration emanatingEdges(edu.umich.visualsoar.graph.Vertex v)
- Specified by:
emanatingEdges
in class Graph
incidentEdges
public java.util.Enumeration incidentEdges(edu.umich.visualsoar.graph.Vertex v)
- Specified by:
incidentEdges
in class Graph
reduce
public void reduce(java.util.List listOfStartVertices)
- Description copied from class:
DirectedGraph
- This function finds all vertices that are unreachable from a state
and adds them to a list of holes so that they can be recycled for later
use
- Specified by:
reduce
in class DirectedGraph
resolve
public void resolve()
- Specified by:
resolve
in class DirectedGraph