org.caida.otter
Class PathSet

java.lang.Object
  |
  +--org.caida.otter.PathSet

public class PathSet
extends java.lang.Object

Store a collection of Paths and their associated statistics


Method Summary
 void addPath(java.util.Vector newPath, float weight, boolean orientation)
          Add a path to the path list (no calculcations yet)
 int calcMaxDepth()
          Calculate the max depth over the entire graph.
 int countPathsContainingNode(java.lang.String nodeName)
          Count all the times that a node is referenced in any path and return that count
 int countTotalPathsContainingLink(java.lang.String nodeName1, java.lang.String nodeName2)
          count all the times that a node is referenced in any path and return that count.
 int countUniquePathsContainingLink(java.lang.String nodeName1, java.lang.String nodeName2)
          Count all the times that a node is referenced in any path and return that count.
 java.util.Vector getAllBottom()
          Get all nodes that are at the bottom of the graph as indicated by that path's orientation.
 java.util.Vector getAllDestinations()
          Originally meant for backwards compatibility, its convenient to figure out the names of all the paths that were oriented in a certain direction.
 java.lang.String[] getAllNodes()
          Return an array that is a complete list of all nodes in the graph without duplicates.
 java.util.Vector getAllSources()
          Originally meant for backwards compatibility, its convenient to figure out the names of all the paths that were oriented in a certain direction.
 java.util.Vector getAllTop()
          Get all nodes that are at the top of the graph as indicated by that path's orientation.
 java.lang.String getASName(java.lang.String nodeName)
          retrieve AS Name data
 int getASNumber(java.lang.String nodeName)
          retrieve AS data
 java.lang.String getAttributeName(java.lang.String nodeName)
          retrieve Attribute Name data
 java.util.Vector getChildren(java.lang.String nodeName)
          return the children of a node from across all paths
 java.util.Vector getChildren(java.lang.String nodeName, java.lang.String source)
          return the children of a node from a specific source
 java.lang.String getCity(java.lang.String nodeName)
          retrieve city data
 int getDepth(java.lang.String nodeName)
          Find the depth of a node in the graph
 float getDestLinkWeight(java.lang.String fromNodeName, java.lang.String toNodeName, java.lang.String destination)
          look up all paths the link is in, sum path weights (according to destination)
 float getLat(java.lang.String nodeName)
          retrieve lat data
 java.util.Vector getLinkDestinations(java.lang.String fromNodeName, java.lang.String toNodeName)
          look up node in list, return non-redundant list of sources that it appears in.
 java.util.Vector getLinkSources(java.lang.String fromNodeName, java.lang.String toNodeName)
           
 float getLong(java.lang.String nodeName)
          retrieve long data
 int getMaxDepth()
          Return the max depth of the graph.
 java.util.Vector getNodeNeighbors(java.lang.String nodeName)
          Get the neighbors of a node (their string names that is)
 java.util.Vector getNodeSources(java.lang.String nodeName)
          look up node in list, return non-redundant list of sources that it appears in.
 float getNodeWeight(java.lang.String nodeName, java.lang.String source)
          look up all paths the node is in, sum path weights
 float getPairLinkWeight(java.lang.String fromNodeName, java.lang.String toNodeName, java.lang.String source, java.lang.String destination)
          look up all paths the link is in, sum path weights (according to source)
 float getSourceAndDestLinkWeight(java.lang.String fromNodeName, java.lang.String toNodeName, java.lang.String source_dest)
          Get inbound and outbound in a single measurement
 float getSourceLinkWeight(java.lang.String fromNodeName, java.lang.String toNodeName, java.lang.String source)
          look up all paths the link is in, sum path weights (according to source)
 void setASName(java.lang.String nodeName, java.lang.String ASName)
          Store AS name associated with a node
 void setASNumber(java.lang.String nodeName, int as_num)
          Store AS Number associated with a node
 void setAttributeName(java.lang.String nodeName, java.lang.String AttributeName)
          Store Attribute name that will be used to sort columns
 void setCity(java.lang.String nodeName, java.lang.String city_name)
          Store City associated with a node
 void setLat(java.lang.String nodeName, float lat)
          Store Latitude associated with a node
 void setLong(java.lang.String nodeName, float longitude)
          Store Longitude associated with a node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addPath

public void addPath(java.util.Vector newPath,
                    float weight,
                    boolean orientation)
Add a path to the path list (no calculcations yet)
Parameters:
newPath - Vector of Strings, each one representing a single node in the path.
weight - A path weight associated with the path.
orientation - The orientation of the new path.

calcMaxDepth

public int calcMaxDepth()
Calculate the max depth over the entire graph. All nodes should be reachable from at least one of the listed sources via either an inbound or outbound path. The sources used in the max depth calculation are the beginning of a foward path or the end of a backward path.

getDepth

public int getDepth(java.lang.String nodeName)
Find the depth of a node in the graph
Parameters:
nodeName - The node to look up the max depth of
Returns:
The depth of the nodes requested, else -1.

getAllDestinations

public java.util.Vector getAllDestinations()
Originally meant for backwards compatibility, its convenient to figure out the names of all the paths that were oriented in a certain direction. Here we hard code that 'false' values for orientation are used. Then since all paths are stored source to destination, we excise the last element
Returns:
Vector of all the destination node names in the graph.

getAllSources

public java.util.Vector getAllSources()
Originally meant for backwards compatibility, its convenient to figure out the names of all the paths that were oriented in a certain direction. Here we hard code that 'true' values for orientation are used. Then since all paths are stored source to destination, we excise the first element
Returns:
Vector of all the source node names in the graph.

getAllTop

public java.util.Vector getAllTop()
Get all nodes that are at the top of the graph as indicated by that path's orientation.
Returns:
Vector of all the nodes appearing at the top of the graph. (involves looking at foward and backward paths)

getAllBottom

public java.util.Vector getAllBottom()
Get all nodes that are at the bottom of the graph as indicated by that path's orientation.
Returns:
Vector of all the nodes appearing at the bottom of the graph. (involves looking at foward and backward paths)

getPairLinkWeight

public float getPairLinkWeight(java.lang.String fromNodeName,
                               java.lang.String toNodeName,
                               java.lang.String source,
                               java.lang.String destination)
look up all paths the link is in, sum path weights (according to source)
Parameters:
fromNodeName - The "from" node in the pairwise link being looked at.
toNodeName - The "to" node in the pairwise link being looked at.
source - The name of the source node in the path. This would be the first node in the path we want to look at.
destination - The name of the destination node in the path. This would be the last node in the path we want to look at.
Returns:
The weight of a link between the two given node names for a specific source and destination pair.

getSourceAndDestLinkWeight

public float getSourceAndDestLinkWeight(java.lang.String fromNodeName,
                                        java.lang.String toNodeName,
                                        java.lang.String source_dest)
Get inbound and outbound in a single measurement
Parameters:
fromNodeName - The "from" node in the link we want to look at.
toNodeName - The "to" node in the link we want to look at.
source_dest - The name of the node that we're treating as our source and destination. We're just looking for all paths involving this node as either of the two.
Returns:
The total usage inbound and outbound of a link.

getDestLinkWeight

public float getDestLinkWeight(java.lang.String fromNodeName,
                               java.lang.String toNodeName,
                               java.lang.String destination)
look up all paths the link is in, sum path weights (according to destination)
Parameters:
fromNodeName - The "from" node in the link we want to look at.
toNodeName - The "to" node in the link we want to look at.
destination - The destination of the paths we want to look at.
Returns:
The weight of the selected link over all paths going to that destination.

getSourceLinkWeight

public float getSourceLinkWeight(java.lang.String fromNodeName,
                                 java.lang.String toNodeName,
                                 java.lang.String source)
look up all paths the link is in, sum path weights (according to source)
Parameters:
fromNodeName - The "from" node in the selected link
toNodeName - The "to" node in the selected link
source - The source that we want to select all paths involving.
Returns:
The weight of the selected link over all paths involving the specified source.

getNodeWeight

public float getNodeWeight(java.lang.String nodeName,
                           java.lang.String source)
look up all paths the node is in, sum path weights
Parameters:
nodeName - The node we're looking up
source - The source we're interested in that will supply the paths we extract data from.
Returns:
The weight of the node in all paths involving the specified source.

getLinkDestinations

public java.util.Vector getLinkDestinations(java.lang.String fromNodeName,
                                            java.lang.String toNodeName)
look up node in list, return non-redundant list of sources that it appears in.
Parameters:
fromNodeName - The "from" node of the specified link
toNodeName - The "to" node of the specified link
Returns:
A Vector of all the destinations of the paths that a link is involved in.

getLinkSources

public java.util.Vector getLinkSources(java.lang.String fromNodeName,
                                       java.lang.String toNodeName)

getNodeSources

public java.util.Vector getNodeSources(java.lang.String nodeName)
look up node in list, return non-redundant list of sources that it appears in.
Parameters:
nodeName - The name of the specified node
Returns:
A Vector of all the sources of paths that the specified node is found in.

countPathsContainingNode

public int countPathsContainingNode(java.lang.String nodeName)
Count all the times that a node is referenced in any path and return that count
Parameters:
nodeName - The node to find in the path list
Returns:
The number of different paths the specified node appears in.

countUniquePathsContainingLink

public int countUniquePathsContainingLink(java.lang.String nodeName1,
                                          java.lang.String nodeName2)
Count all the times that a node is referenced in any path and return that count. A single source-destination pair may count only once.
Parameters:
nodeName1 - The "from" node in the link.
nodeName2 - The "to" node in the link.
Returns:
The number of unique paths containing that link.

countTotalPathsContainingLink

public int countTotalPathsContainingLink(java.lang.String nodeName1,
                                         java.lang.String nodeName2)
count all the times that a node is referenced in any path and return that count.
Parameters:
nodeName1 - The "from" node in the specified link.
nodeName2 - The "to" node in the specified link.
Returns:
The total count of paths containing the specified link.

getAllNodes

public java.lang.String[] getAllNodes()
Return an array that is a complete list of all nodes in the graph without duplicates.
Returns:
An array of node names consisting of all the nodes in the graph.

setLat

public void setLat(java.lang.String nodeName,
                   float lat)
Store Latitude associated with a node
Parameters:
nodeName - The node to set the latitude for.
lat - The latitude to set that node to.

setLong

public void setLong(java.lang.String nodeName,
                    float longitude)
Store Longitude associated with a node
Parameters:
nodeName - The node to set the longitude for.
longitude - The longitude to set that node to.

setCity

public void setCity(java.lang.String nodeName,
                    java.lang.String city_name)
Store City associated with a node
Parameters:
nodeName - The node to set the city name for.
city_name - The city name to assign to that node.

setASName

public void setASName(java.lang.String nodeName,
                      java.lang.String ASName)
Store AS name associated with a node
Parameters:
nodeName - The node to set the AS name for.
ASName - The AS name to assign to that node.

setASNumber

public void setASNumber(java.lang.String nodeName,
                        int as_num)
Store AS Number associated with a node
Parameters:
nodeName - The node to set the AS for.
as_num - The AS to assign to that node.

setAttributeName

public void setAttributeName(java.lang.String nodeName,
                             java.lang.String AttributeName)
Store Attribute name that will be used to sort columns
Parameters:
nodeName - The node to set the Attribute name for.
AttributeName - The Attribute name to assign to that node.

getAttributeName

public java.lang.String getAttributeName(java.lang.String nodeName)
retrieve Attribute Name data
Parameters:
nodeName - The name of the node to retrieve the Attribute name for
Returns:
String of the Attribute name, else null

getLat

public float getLat(java.lang.String nodeName)
retrieve lat data
Parameters:
nodeName - The name of the node to retrieve latitude info for.
Returns:
the Latitude of the specified node, else 0.

getLong

public float getLong(java.lang.String nodeName)
retrieve long data
Parameters:
nodeName - The name of the node to retrieve longitude info for.
Returns:
the Longitude of the specified node, else 0.

getASNumber

public int getASNumber(java.lang.String nodeName)
retrieve AS data
Parameters:
nodeName - The name of the node to retrieve the AS num for.
Returns:
The AS number for the specified node, else -1.

getCity

public java.lang.String getCity(java.lang.String nodeName)
retrieve city data
Parameters:
nodeName - The name of the node to retrieve the city name for.
Returns:
String of the city name, else null

getASName

public java.lang.String getASName(java.lang.String nodeName)
retrieve AS Name data
Parameters:
nodeName - The name of the node to retrieve the city name for.
Returns:
String of the AS name, else null

getChildren

public java.util.Vector getChildren(java.lang.String nodeName,
                                    java.lang.String source)
return the children of a node from a specific source
Parameters:
nodeName - The node to look for children for.
source - The source of paths we will look for children in.
Returns:
A Vector of the children of a node given a specified source.

getChildren

public java.util.Vector getChildren(java.lang.String nodeName)
return the children of a node from across all paths
Parameters:
nodeName - The node we want to retrieve children for.
Returns:
Vector of all children for that node across all sources.

getMaxDepth

public int getMaxDepth()
Return the max depth of the graph. calcMaxDepth() must be called for this to give meaningful results.
Returns:
The max depth of the last run of calcMaxDepth()

getNodeNeighbors

public java.util.Vector getNodeNeighbors(java.lang.String nodeName)
Get the neighbors of a node (their string names that is)
Parameters:
nodeName - node to find neighbors of
Returns:
vector of node names (strings)