|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.uka.algo.GT3D.BreadthFirstSearchDemo2
public class BreadthFirstSearchDemo2
This class implements Breadth First Search.
Field Summary | |
---|---|
(package private) java.util.LinkedList<edu.uci.ics.jung.graph.Vertex> |
candidates
Waiting list for nodes |
(package private) boolean |
initialized
|
(package private) boolean |
ready
|
private edu.uci.ics.jung.graph.DirectedGraph |
theGraph
The graph we are dealing with, Read in init . |
(package private) java.util.Map<edu.uci.ics.jung.graph.Vertex,java.lang.Boolean> |
visited
Map of visited nodes |
private BFSVisualizer |
visualizer
|
Constructor Summary | |
---|---|
BreadthFirstSearchDemo2()
|
Method Summary | |
---|---|
boolean |
atStart()
|
protected BFSVisualizer |
createSceneGraph()
|
boolean |
finished()
|
javax.media.j3d.BranchGroup |
getChild()
|
javax.vecmath.Vector3d |
getStartPosition()
The scene must be centered at the origin. |
void |
init()
|
void |
init(edu.uci.ics.jung.graph.DirectedGraph aGraph)
|
void |
init(java.lang.String filename)
Initialize the graph, the map of visited nodes and put the first vertex into the queue. |
protected void |
markNode(edu.uci.ics.jung.graph.Vertex v)
Visualize a visited node. |
void |
nextStep()
Perform the next step of the search: Get the next vertex fromt the queue and mark. all its neighbours. |
void |
previousStep()
this method does nothing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private edu.uci.ics.jung.graph.DirectedGraph theGraph
init
.
java.util.LinkedList<edu.uci.ics.jung.graph.Vertex> candidates
java.util.Map<edu.uci.ics.jung.graph.Vertex,java.lang.Boolean> visited
boolean initialized
boolean ready
private BFSVisualizer visualizer
Constructor Detail |
---|
public BreadthFirstSearchDemo2()
Method Detail |
---|
public void init(java.lang.String filename)
init
in interface StepwiseAlgorithm
filename
- the name of the GraphML file to read from.StepwiseAlgorithm.init(java.lang.String)
public void init(edu.uci.ics.jung.graph.DirectedGraph aGraph)
public void init()
public void nextStep()
nextStep
in interface StepwiseAlgorithm
StepwiseAlgorithm.nextStep()
protected void markNode(edu.uci.ics.jung.graph.Vertex v)
v
- the current node.public void previousStep()
previousStep
in interface StepwiseAlgorithm
StepwiseAlgorithm.previousStep()
public boolean finished()
finished
in interface StepwiseAlgorithm
true
iff the algorithm has terminated.public javax.media.j3d.BranchGroup getChild()
getChild
in interface Scene3DProvider
public javax.vecmath.Vector3d getStartPosition()
Scene3DProvider
getStartPosition
in interface Scene3DProvider
protected BFSVisualizer createSceneGraph()
public boolean atStart()
atStart
in interface StepwiseAlgorithm
true
iff the algorithm is in its starting state.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |