public class Dijkstra
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.ArrayList<Junction> |
junctions |
Node[] |
nodeList |
static java.util.ArrayList<Station> |
stations |
Constructor and Description |
---|
Dijkstra() |
Modifier and Type | Method and Description |
---|---|
void |
computePaths(Node source)
Compute paths takes a source node and updates the Tentative distance of all other nodes
with the an integer value that represents the length between the source node and that
particular nodes.
|
java.util.List<Node> |
getShortestPathTo(Node target)
getShortestPathTo is a function that takes in a target node and gets the shortest path to that node to another node, then returns the path in a list of nodes.
|
void |
initialiseGraph()
everytime Dijkstra is called a graph is created specifically for that instance.
|
Node |
lookUpNode(MapObj mapObj)
a lookup table that returns a Node instance for a given map obj, it should be noted that nodes are just extended mapobj's.
|
public static java.util.ArrayList<Station> stations
public static java.util.ArrayList<Junction> junctions
public Node[] nodeList
public void computePaths(Node source)
source:
- the source nodepublic java.util.List<Node> getShortestPathTo(Node target)
target
- public Node lookUpNode(MapObj mapObj)
mapObj
- public void initialiseGraph()