be.ac.ulg.montefiore.run.totem.domain.simplifiedDomain
Class SimplifiedDomain

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.simplifiedDomain.SimplifiedDomain

public class SimplifiedDomain
extends java.lang.Object

A simple view of a domain topology. A SimplifiedDomain can be used by algorithms that needs a very simple view of the topology (nodes and links). The SimplifiedDomain is more optimised that Domain and so can be more efficient for complex computing algorithm.

Creation date: 13-Jan-2005 10:37:16

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be), Simon Balon (balon@run.montefiore.ulg.ac.be)

Nested Class Summary
 class SimplifiedDomain.Link
          Contains the link information
 
Constructor Summary
SimplifiedDomain()
           
SimplifiedDomain(java.lang.String name, int nbNodes, int maxLinks)
          Simple constructor
 
Method Summary
 void addLink(int linkId, int srcNode, int dstNode, float capacity, float weight, float delay)
          Add a link
 java.lang.Object clone()
           
 void display()
           
 java.util.List<SimplifiedDomain.Link> getConnectivity(int srcNode, int dstNode)
           
 int[] getInLinks(int nodeId)
          Get all the input links of a node
 float getLinkCapacity(int linkId)
          Get the capacity of the link
 float getLinkDelay(int linkId)
          Get the weight of the link
 int getLinkDst(int linkId)
          Get the destination node of the link
 SimplifiedDomain.Link[] getLinks()
           
 int getLinkSrc(int linkId)
          Get the source node of the link
 float getLinkWeight(int linkId)
          Get the weight of the link
 java.lang.String getName()
           
 int getNbLinks()
          Retun the number of links
 int getNbNodes()
          Retun the number of nodes
 int[] getNodesPath(int[] linksPath)
           
 int[] getOutLinks(int nodeId)
          Get all the output links of a node
 boolean isLink(int linkId)
           
 boolean isNode(int nodeId)
          As the nodeId are not necessarely consecutive, this method checks if the nodeId is a node by cheking that the node has out links.
 void removeInOutLinks(int nodeId)
           
 void removeLink(int linkId)
           
 float setLinkWeight(int linkId, float weight)
          Set the link weight
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplifiedDomain

public SimplifiedDomain()

SimplifiedDomain

public SimplifiedDomain(java.lang.String name,
                        int nbNodes,
                        int maxLinks)
Simple constructor

Parameters:
name -
nbNodes - number of nodes
maxLinks - number of links
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getLinks

public SimplifiedDomain.Link[] getLinks()

getConnectivity

public java.util.List<SimplifiedDomain.Link> getConnectivity(int srcNode,
                                                             int dstNode)

addLink

public void addLink(int linkId,
                    int srcNode,
                    int dstNode,
                    float capacity,
                    float weight,
                    float delay)
Add a link

Parameters:
srcNode - source node
dstNode - destination node
capacity - capacity of the link
weight - weight of the link
delay - delay of the link

removeInOutLinks

public void removeInOutLinks(int nodeId)
                      throws LinkNotFoundException
Throws:
LinkNotFoundException

removeLink

public void removeLink(int linkId)
                throws LinkNotFoundException
Throws:
LinkNotFoundException

getNbNodes

public int getNbNodes()
Retun the number of nodes

Returns:
the number of nodes

getNbLinks

public int getNbLinks()
Retun the number of links

Returns:
the number of links

getLinkSrc

public int getLinkSrc(int linkId)
               throws LinkNotFoundException
Get the source node of the link

Parameters:
linkId - ID of the link
Returns:
node ID of the source
Throws:
LinkNotFoundException

getLinkDst

public int getLinkDst(int linkId)
               throws LinkNotFoundException
Get the destination node of the link

Parameters:
linkId - ID of the link
Returns:
node ID of the destination
Throws:
LinkNotFoundException

getLinkCapacity

public float getLinkCapacity(int linkId)
                      throws LinkNotFoundException
Get the capacity of the link

Parameters:
linkId - ID of the link
Returns:
link capacity
Throws:
LinkNotFoundException

getLinkWeight

public float getLinkWeight(int linkId)
                    throws LinkNotFoundException
Get the weight of the link

Parameters:
linkId - ID of the link
Returns:
link weight
Throws:
LinkNotFoundException

setLinkWeight

public float setLinkWeight(int linkId,
                           float weight)
                    throws LinkNotFoundException
Set the link weight

Parameters:
linkId -
weight -
Returns:
Throws:
LinkNotFoundException

getLinkDelay

public float getLinkDelay(int linkId)
                   throws LinkNotFoundException
Get the weight of the link

Parameters:
linkId - ID of the link
Returns:
link weight
Throws:
LinkNotFoundException

isNode

public boolean isNode(int nodeId)
As the nodeId are not necessarely consecutive, this method checks if the nodeId is a node by cheking that the node has out links.

Parameters:
nodeId -
Returns:
false is the node has no outLinks and true otherwise

isLink

public boolean isLink(int linkId)

getOutLinks

public int[] getOutLinks(int nodeId)
                  throws NodeNotFoundException
Get all the output links of a node

Parameters:
nodeId - ID of the node
Returns:
a array of the output link ID
Throws:
NodeNotFoundException

getInLinks

public int[] getInLinks(int nodeId)
                 throws NodeNotFoundException
Get all the input links of a node

Parameters:
nodeId - ID of the node
Returns:
a array of the input link ID
Throws:
NodeNotFoundException

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

display

public void display()

getNodesPath

public int[] getNodesPath(int[] linksPath)
                   throws LinkNotFoundException
Throws:
LinkNotFoundException


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.