Import
Class GTTSImport
java.lang.Object
|
+--Import.GTTSImport
- public class GTTSImport
- extends java.lang.Object
Functionality to import topologies that are saved as GT-ITM's
Transit-Stub alt format (*.gtts files) into our data structures.
Because GT-ITM's transit-stub format defines a neat grouping of
router-nodes, we treat each grouping as a distinct AS (either a
transit-AS or a stub-AS) and thus can assign each router node an
ASid (that is the ID of the AS node it belong to). Also, like
GTImport, we treated GTITM topologies as an undirected graph.
(GTITM topologies are undirected in the sense that they have double
directed edges between each pair or neighboring nodes). This class
does not know how to import GT-ITM topologies that are flat (that
is, geo
generated topologies.) To import these
topologies, use the GTImport class instead.
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 |
GTTSImport(java.io.File inFile)
Class Constructor: Creates a constructor to import router-level
topologies only. |
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 |
GTTSImport
public GTTSImport(java.io.File inFile)
- Class Constructor: Creates a constructor to import router-level
topologies only. (AS level topologies do not make sense for
the transit-stub format)
- Parameters:
inFile
- the file to import the topology from
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)