Import
Class NLANRImport

java.lang.Object
  |
  +--Import.NLANRImport

public class NLANRImport
extends java.lang.Object

Functionality to import topologies from NLANR ASConnlist format (*.nlanr) back into our data structures. We use directed edges in the graph to represent NLANR topologies.

Generally, all Import routines would be called by the Model.FileModel class. However, if you only need to import the Graph and not the Model parameters, you can simply call the parse method to obtain the Graph. The model paramters can be access by the getFormatParams method.

All NodeIDs are reinitialized to native BRITE id. A mapping between the actual IDs and the new assigned BRITE Ids are stored in a hashmap id2id with key as the actual IDs and values as the BRITE ids. You can access this mapping by the getIDMap() method.


Constructor Summary
NLANRImport(java.io.File inFile, int type)
          Class Constructor: Creates a constructor to import either a router-level or an AS-level topology from a specified file.
 
Method Summary
 java.lang.String getFormatParams()
          Model specific parameters if the import file format specifies it.
 java.util.HashMap getIDMap()
          When importing the graph structure in the specified topology, the actual NodeIDs are reinitialized and converted to BRITE IDs.
static void main(java.lang.String[] args)
           
 Graph parse()
          File parsing is done here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NLANRImport

public NLANRImport(java.io.File inFile,
                   int type)
Class Constructor: Creates a constructor to import either a router-level or an AS-level topology from a specified file.
Parameters:
inFile - the file to import the topology from
type - Either ModelConstants.AS_FILE or ModelConstants.RT_FILE
Method Detail

getIDMap

public java.util.HashMap getIDMap()
When importing the graph structure in the specified topology, the actual NodeIDs are reinitialized and converted to BRITE IDs. A mapping with the actual file IDs as keys and the BRITE IDs as values is maintained, which this method returns.
Returns:
HashMap the mapping

getFormatParams

public java.lang.String getFormatParams()
Model specific parameters if the import file format specifies it. If none exist, "" is returned.
Returns:
String the format specific parameters.

parse

public Graph parse()
File parsing is done here.
Returns:
Graph A BRITE graph containing the topology read in the format.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception