be.ac.ulg.montefiore.run.totem.trafficMatrix.model
Interface TrafficMatrix

All Superinterfaces:
java.lang.Iterable
All Known Implementing Classes:
TrafficMatrixImpl

public interface TrafficMatrix
extends java.lang.Iterable

This class represents a traffic matrix.

Creation date: 27-janv.-2005

Author:
Jean Lepropre (lepropre@run.montefiore.ulg.ac.be)

Nested Class Summary
static interface TrafficMatrix.TrafficMatrixElem
          Represents an element of the traffic matrix.
 
Method Summary
 float get(int src, int dst)
          Returns the amount of traffic exchanged by the nodes src and dst.
 float get(java.lang.String src, java.lang.String dst)
          Returns the amount of traffic exchanged by the nodes src and dst.
 int getASID()
          Returns the AS ID of the traffic matrix.
 java.util.Calendar getDate()
          Get the date of matrix measurement
 double getDuration()
          Get the matrix measurement duration
 double[] getLinkLoad()
          Deprecated. Use class LinkLoadComputer instead.
 LinkLoadStrategy getLinkLoadStrategy()
          Deprecated. Use class LinkLoadComputer instead.
 double[] getLinkUtilisation()
          Deprecated. Use class LinkLoadComputer instead.
 TrafficMatrixChangeObserver getObserver()
          Get the change observer.
 int getTmId()
          Returns the id associated with the traffic matrix if it has already been set.
 BandwidthUnit getUnit()
          returns the unit used in the matrix representation
 boolean isSetTmId()
          Returns true if the id had been set
 java.util.Iterator<TrafficMatrix.TrafficMatrixElem> iterator()
          Returns an iterator over the elements in this traffic matrix.
 void set(int src, int dst, float value)
          Sets the amount of traffic exchanged by the nodes src and dst.
 void set(java.lang.String src, java.lang.String dst, float value)
          Sets the amount of traffic exchanged by the nodes src and dst.
 void setDate(java.util.Calendar date)
          Set the date of matrix measurement
 void setDuration(double duration)
          Set the matrix measurement duration
 void setLinkLoadStrategy(LinkLoadStrategy strategy)
          Deprecated. Use class LinkLoadComputer instead.
 void setTmId(int tmId)
          Associate an id with the matrix if it not already set.
 void setUnit(BandwidthUnit unit)
          This function sets the unit of the matrix representation.
 float[] toOneDimensionalArray()
          Returns an array representing the matrix in one-dimensional form.
 float[][] toTwoDimensionalArray()
          Returns a float array representing the traffic matrix.
 void unsetTmId()
          Clear the Tm Id associated with the matrix.
 

Method Detail

getObserver

TrafficMatrixChangeObserver getObserver()
Get the change observer.

Returns:
the observer

getTmId

int getTmId()
            throws TrafficMatrixIdException
Returns the id associated with the traffic matrix if it has already been set.

Returns:
The traffic matrix Id
Throws:
TrafficMatrixIdException - if the id has not been set.

setTmId

void setTmId(int tmId)
             throws TrafficMatrixIdException
Associate an id with the matrix if it not already set. This method can be called only once without throwing an exception. Use unsetTmId() to reset the tm id.

Throws:
TrafficMatrixIdException - if the id has already been set.

isSetTmId

boolean isSetTmId()
Returns true if the id had been set

Returns:

unsetTmId

void unsetTmId()
Clear the Tm Id associated with the matrix.


getASID

int getASID()
Returns the AS ID of the traffic matrix.

Returns:
The AS ID of the traffic matrix.

getUnit

BandwidthUnit getUnit()
returns the unit used in the matrix representation

Returns:

setUnit

void setUnit(BandwidthUnit unit)
This function sets the unit of the matrix representation. It can be called only if the unit has not already been set or with an argument equals to the unit already set. Otherwise an IllegalAccessError will be thrown.

Parameters:
unit -

getDate

java.util.Calendar getDate()
Get the date of matrix measurement

Returns:
the date of matrix measurement

setDate

void setDate(java.util.Calendar date)
Set the date of matrix measurement

Parameters:
date - the date of matrix measurement

getDuration

double getDuration()
Get the matrix measurement duration

Returns:
the matrix measurement duration

setDuration

void setDuration(double duration)
Set the matrix measurement duration

Parameters:
duration - the matrix measurement duration

iterator

java.util.Iterator<TrafficMatrix.TrafficMatrixElem> iterator()
Returns an iterator over the elements in this traffic matrix. The elements of the traffic matrix are returned row by row by the iterator. Note that the returned iterator doesn't support the remove operation.

Specified by:
iterator in interface java.lang.Iterable
Returns:
An iterator over the elements in this traffic matrix.

get

float get(java.lang.String src,
          java.lang.String dst)
          throws NodeNotFoundException
Returns the amount of traffic exchanged by the nodes src and dst.

Parameters:
src - The source node.
dst - The destination node.
Returns:
The amount of traffic exchanged by the nodes src and dst.
Throws:
NodeNotFoundException - If there is no node src or no node dst.

get

float get(int src,
          int dst)
          throws NodeNotFoundException
Returns the amount of traffic exchanged by the nodes src and dst.

Parameters:
src - The source node.
dst - The destination node.
Returns:
The amount of traffic exchanged by the nodes src and dst.
Throws:
NodeNotFoundException - If there is no node src or no node dst.

set

void set(java.lang.String src,
         java.lang.String dst,
         float value)
         throws NodeNotFoundException
Sets the amount of traffic exchanged by the nodes src and dst.

Parameters:
src - The source node.
dst - The destination node.
value - The amount of traffic.
Throws:
NodeNotFoundException - If there is no node src or no node dst.

set

void set(int src,
         int dst,
         float value)
         throws NodeNotFoundException
Sets the amount of traffic exchanged by the nodes src and dst.

Parameters:
src - The source node.
dst - The destination node.
value - The amount of traffic.
Throws:
NodeNotFoundException - If there is no node src or no node dst.

toOneDimensionalArray

float[] toOneDimensionalArray()
Returns an array representing the matrix in one-dimensional form. The value associated with the pair (srcId, dstId) is at index domain.getConvertor.getNodeId(srcId)*domain.getConvertor.getMaxNodeId()+domain.getConvertor.getNodeId(dstId) in the resulting array.

Returns:

toTwoDimensionalArray

float[][] toTwoDimensionalArray()
Returns a float array representing the traffic matrix. The value associated with the pair (srcId, dstId) is at index [domain.getConvertor.getNodeId(srcId)][domain.getConvertor.getNodeId(dstId)].

Returns:

setLinkLoadStrategy

@Deprecated
void setLinkLoadStrategy(LinkLoadStrategy strategy)
Deprecated. Use class LinkLoadComputer instead.

Set the strategy of link load computation. This strategy is used to compute link load and link utilisation.

Parameters:
strategy - the link load computation strategy

getLinkLoadStrategy

@Deprecated
LinkLoadStrategy getLinkLoadStrategy()
Deprecated. Use class LinkLoadComputer instead.

Get the link load computation strategy

Returns:
the link load computation strategy

getLinkLoad

@Deprecated
double[] getLinkLoad()
                     throws NoRouteToHostException,
                            RoutingException
Deprecated. Use class LinkLoadComputer instead.

Returns the link loads computed by the LinkLoadStrategy. The link load is defined by the total amound of traffic on the link express in bandwidth unit. The returned array is indexed by the integer indexes of the domain converter. These indexes can be non-consecutive and thus, some holes can appear in the array. For this reason, the number of elements of the array can be higher than the number of links of the network. Let ret be the returned array. ret[i] is the load of the link InterDomainManager.getInstance().getDomain(this.getASID()).getConvertor().getLinkId(i).

Returns:
the link loads computed by the LinkLoadStrategy.
Throws:
NoRouteToHostException - If there is no route between a pair of nodes.
RoutingException - if an error occurred during the routing process.

getLinkUtilisation

@Deprecated
double[] getLinkUtilisation()
                            throws NoRouteToHostException,
                                   RoutingException
Deprecated. Use class LinkLoadComputer instead.

Returns the link utilisations computed by the LinkLoadStrategy. The link utilisation is defined by the link load divided by the link capacity express in percentage. Let ret be the returned array. ret[i] is the utilisation of the link InterDomainManager.getInstance().getDomain(this.getASID()).getConvertor().getLinkId(i).

Returns:
the link utilisations if we route the traffic using a SPF algorithm.
Throws:
NoRouteToHostException - if there is no route between a pair of nodes.
RoutingException - if an error occurred during the routing process.


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