* Calculate shortest paths to all destinations in the topology set
*/
private void calculateDijkstra(){
_routingSet.clear();
for (LinkTuple linkTuple : _linkSet){
RoutingTuple newTuple = new RoutingTuple(linkTuple.getAddress(), linkTuple.getAddress(), 1);
_routingSet.add(newTuple);
}
int h = 1;
while (true){
boolean tupleAdded = false;
for (TopologyTuple topologyTuple : _topologySet){
if (_routingSet.containsDestination(topologyTuple.getTo()) || topologyTuple.getTo().equals(_origAddress))
continue;
RoutingTuple previous = _routingSet.getDestination(topologyTuple.getFrom(), h);
if (previous != null){
RoutingTuple newTuple = new RoutingTuple(topologyTuple.getTo(), previous.getNexthop(), h+1);
_routingSet.add(newTuple);
tupleAdded = true;
}
}
h++;