urv.emulator
Class VirtualNetworkInformation

java.lang.Object
  extended by urv.emulator.VirtualNetworkInformation

public class VirtualNetworkInformation
extends java.lang.Object

This class offers information to perform the simulation. Offers information about the network topology (neighbour information) and also about new Virtual IP generation

Author:
Marcel Arrufat Arias

Method Summary
 boolean areNeighbours(java.net.InetAddress addr1, java.net.InetAddress addr2)
          Checks if the two nodes are neighbours (are in radio range) in the current network topology
 java.net.InetAddress getEmuNodeAddress(int nodeId)
          Returns a new InetAddress for an existing node in the simulation
static VirtualNetworkInformation getInstance()
           
 java.util.List<java.net.InetAddress> getNeighbours(java.net.InetAddress addr)
          Returns a list with all the neighbours of the given address If there are no neighbours, means that the node is isolated and is not currently connected to the others
 int getNetworkSize()
          Returns the total number of nodes in the network
 java.lang.String getStringGraph()
           
 boolean performTopologyChangesUntilSecond(int second)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static VirtualNetworkInformation getInstance()

areNeighbours

public boolean areNeighbours(java.net.InetAddress addr1,
                             java.net.InetAddress addr2)
Checks if the two nodes are neighbours (are in radio range) in the current network topology

Parameters:
addr1 -
addr2 -
Returns:

getEmuNodeAddress

public java.net.InetAddress getEmuNodeAddress(int nodeId)
Returns a new InetAddress for an existing node in the simulation

Parameters:
nodeId - id of the node in the simulation
Returns:

getNeighbours

public java.util.List<java.net.InetAddress> getNeighbours(java.net.InetAddress addr)
Returns a list with all the neighbours of the given address If there are no neighbours, means that the node is isolated and is not currently connected to the others

Parameters:
addr -
Returns:

getNetworkSize

public int getNetworkSize()
Returns the total number of nodes in the network

Returns:

getStringGraph

public java.lang.String getStringGraph()

performTopologyChangesUntilSecond

public boolean performTopologyChangesUntilSecond(int second)