60 lines
1.5 KiB
Text
60 lines
1.5 KiB
Text
@startuml
|
|
class ShortestPathAlgorithm{
|
|
- protected abstract ShortestPathSolution doRun();
|
|
|
|
}
|
|
|
|
class BellmanFordAlgorithm {
|
|
- public class BellmanFordAlgorithm extends ShortestPathAlgorithm
|
|
}
|
|
|
|
class ShortestPathObserver {
|
|
- public void notifyOriginProcessed(Node node);
|
|
- public void notifyNodeReached(Node node);
|
|
- public void notifyNodeMarked(Node node);
|
|
- public void notifyDestinationReached(Node node);
|
|
}
|
|
|
|
class ShortestPathSolution {
|
|
+ private final Path path;
|
|
}
|
|
|
|
class ShortestPathTextObserver {
|
|
+ private final PrintStream stream;
|
|
|
|
- public ShortestPathTextObserver(PrintStream stream);
|
|
- public void notifyOriginProcessed(Node node);
|
|
- public void notifyNodeReached(Node node);
|
|
- public void notifyNodeMarked(Node node);
|
|
- public void notifyDestinationReached(Node node);
|
|
}
|
|
|
|
class AbstractAlgorithm {
|
|
+ protected final AbstractInputData data;
|
|
+ protected final ArrayList<Observer> observers;
|
|
}
|
|
|
|
class DijkstraAlgorithm {
|
|
}
|
|
|
|
class AStarAlgorithm {
|
|
}
|
|
|
|
class AbstractInputData {
|
|
+ public enum Mode;
|
|
+ private final Graph graph;
|
|
+ protected final ArcInspector arcInspector;
|
|
}
|
|
|
|
class BinaryHeap {
|
|
+ private int currentSize;
|
|
+ protected final ArrayList<E> array;
|
|
}
|
|
|
|
BellmanFordAlgorithm <|-- ShortestPathAlgorithm : extends
|
|
ShortestPathSolution <|-- ShortestPathObserver : extends
|
|
ShortestPathTextObserver <|-- ShortestPathObserver : extends
|
|
DijkstraAlgorithm <|-- ShortestPathAlgorithm : extends
|
|
AStarAlgorithm <|-- DijkstraAlgorithm : extends
|
|
ShortestPathAlgorithm <|-- AbstractAlgorithm : extends
|
|
@enduml
|