|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbe.ac.ulg.montefiore.run.totem.trafficMatrix.model.impl.TrafficMatrixImpl
public class TrafficMatrixImpl
Implementation of the TrafficMatrix interface.
Creation date: 28-janv.-2005
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface be.ac.ulg.montefiore.run.totem.trafficMatrix.model.TrafficMatrix |
|---|
TrafficMatrix.TrafficMatrixElem |
| Constructor Summary | |
|---|---|
TrafficMatrixImpl(Domain domain)
|
|
TrafficMatrixImpl(int asId)
Creates a new TrafficMatrixImpl object. |
|
| 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)
A call to this function indicates the unit used in 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TrafficMatrixImpl(Domain domain)
public TrafficMatrixImpl(int asId)
throws InvalidDomainException
TrafficMatrixImpl object.
asId - The AS ID of the traffic matrix.
InvalidDomainException - If there is no domain with the AS ID asId.| Method Detail |
|---|
public TrafficMatrixChangeObserver getObserver()
TrafficMatrix
getObserver in interface TrafficMatrix
public int getTmId()
throws TrafficMatrixIdException
TrafficMatrix
getTmId in interface TrafficMatrixTrafficMatrixIdException - if the id has not been set.
public void setTmId(int tmId)
throws TrafficMatrixIdException
TrafficMatrixTrafficMatrix.unsetTmId() to reset the tm id.
setTmId in interface TrafficMatrixTrafficMatrixIdException - if the id has already been set.public boolean isSetTmId()
TrafficMatrix
isSetTmId in interface TrafficMatrixpublic void unsetTmId()
TrafficMatrix
unsetTmId in interface TrafficMatrixpublic int getASID()
TrafficMatrix
getASID in interface TrafficMatrixTrafficMatrix.getASID()public BandwidthUnit getUnit()
getUnit in interface TrafficMatrixpublic void setUnit(BandwidthUnit unit)
unit is BandwidthUnit.DEFAULT_UNIT. The unit of the domain will be used (no conversion).
This function can be called only if the unit has not already been set or with an argument equals to the unit already used.
Otherwise an IllegalAccessError will be thrown.
- Specified by:
setUnit in interface TrafficMatrix
- Parameters:
unit -
public java.util.Calendar getDate()
TrafficMatrix
getDate in interface TrafficMatrixpublic void setDate(java.util.Calendar date)
TrafficMatrix
setDate in interface TrafficMatrixdate - the date of matrix measurementpublic double getDuration()
TrafficMatrix
getDuration in interface TrafficMatrixpublic void setDuration(double duration)
TrafficMatrix
setDuration in interface TrafficMatrixduration - the matrix measurement durationpublic java.util.Iterator<TrafficMatrix.TrafficMatrixElem> iterator()
TrafficMatrixremove operation.
iterator in interface TrafficMatrixiterator in interface java.lang.IterableTrafficMatrix.iterator()
public float get(java.lang.String src,
java.lang.String dst)
throws NodeNotFoundException
TrafficMatrixsrc and dst.
get in interface TrafficMatrixsrc - The source node.dst - The destination node.
src and dst.
NodeNotFoundException - If there is no node src or no node dst.TrafficMatrix.get(java.lang.String, java.lang.String)
public float get(int src,
int dst)
throws NodeNotFoundException
TrafficMatrixsrc and dst.
get in interface TrafficMatrixsrc - The source node.dst - The destination node.
src and dst.
NodeNotFoundException - If there is no node src or no node dst.TrafficMatrix.get(int, int)
public void set(java.lang.String src,
java.lang.String dst,
float value)
throws NodeNotFoundException
TrafficMatrixsrc and dst.
set in interface TrafficMatrixsrc - The source node.dst - The destination node.value - The amount of traffic.
NodeNotFoundException - If there is no node src or no node dst.TrafficMatrix.set(java.lang.String, java.lang.String, float)
public void set(int src,
int dst,
float value)
throws NodeNotFoundException
TrafficMatrixsrc and dst.
set in interface TrafficMatrixsrc - The source node.dst - The destination node.value - The amount of traffic.
NodeNotFoundException - If there is no node src or no node dst.TrafficMatrix.set(int, int, float)public float[] toOneDimensionalArray()
domain.getConvertor.getNodeId(srcId)*domain.getConvertor.getMaxNodeId()+domain.getConvertor.getNodeId(dstId)
in the resulting array.
toOneDimensionalArray in interface TrafficMatrixpublic float[][] toTwoDimensionalArray()
[domain.getConvertor.getNodeId(srcId)][domain.getConvertor.getNodeId(dstId)].
toTwoDimensionalArray in interface TrafficMatrixpublic void setLinkLoadStrategy(LinkLoadStrategy strategy)
LinkLoadComputer instead.
setLinkLoadStrategy in interface TrafficMatrixstrategy - the link load computation strategypublic LinkLoadStrategy getLinkLoadStrategy()
LinkLoadComputer instead.
getLinkLoadStrategy in interface TrafficMatrix
public double[] getLinkLoad()
throws NoRouteToHostException,
RoutingException
LinkLoadComputer instead.
ret be the returned array. ret[i] is the
load of the link InterDomainManager.getInstance().getDomain(this.getASID()).getConvertor().getLinkId(i).
getLinkLoad in interface TrafficMatrixNoRouteToHostException - If there is no route between a pair of nodes.
RoutingException - if an error occurred during the routing process.
public double[] getLinkUtilisation()
throws NoRouteToHostException,
RoutingException
LinkLoadComputer instead.
ret be the returned array. ret[i] is the
utilisation of the link InterDomainManager.getInstance().getDomain(this.getASID()).getConvertor().getLinkId(i).
getLinkUtilisation in interface TrafficMatrixNoRouteToHostException - if there is no route between a pair of nodes.
RoutingException - if an error occurred during the routing process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||