Examples of RoutingTuple


Examples of agentj.examples.udprouting.repository.RoutingTuple

   * 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++;
View Full Code Here

Examples of agentj.examples.udprouting.repository.RoutingTuple

      //_logger.info("RoutingSet: " + _node.getRoutingSet().toString());

      if (_node == null || _node.getRoutingSet() == null)
        return -1;
     
      RoutingTuple tuple = _node.getRoutingSet().getDestination(
          inetDest);
      //_logger.info("Routing tuple found:  " + tuple);
     
      if (tuple == null){
        //System.err.println(""); // empty line
        return -1;
      }
     
      int ns2Address = tuple.getNexthop().getAddress()[3];
      //_logger.info("Returning nexthop:  " + ns2Address + "\n");
     
      return ns2Address;
    } catch (UnknownHostException ex) {
      //ignore
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.