be.ac.ulg.montefiore.run.totem.trafficMatrix.model.impl
Class AbstractLinkLoadStrategy

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.trafficMatrix.model.impl.AbstractLinkLoadComputer
      extended by be.ac.ulg.montefiore.run.totem.trafficMatrix.model.impl.AbstractLinkLoadStrategy
All Implemented Interfaces:
LinkLoadComputer, LinkLoadStrategy
Direct Known Subclasses:
BasicIGPShortcutStrategy, IGPShortcutStrategy, OverlayStrategy, SPFLinkLoadStrategy

public abstract class AbstractLinkLoadStrategy
extends AbstractLinkLoadComputer
implements LinkLoadStrategy

This adapter can be used by link load strategy implementations to avoid property methods redefinition. It uses HybridLoadData.

Creation date: 28-Jun-2005 18:00:25

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be)

Field Summary
protected  SettableHybridLoadData data
           
protected  boolean ECMP
           
protected  SPF spf
           
protected  TrafficMatrix tm
           
 
Fields inherited from class be.ac.ulg.montefiore.run.totem.trafficMatrix.model.impl.AbstractLinkLoadComputer
changeListener, domain
 
Constructor Summary
protected AbstractLinkLoadStrategy(Domain domain, TrafficMatrix tm)
          Creates a linkLoadStrategy object to compute load on the given domain from the given traffic matrix.
protected AbstractLinkLoadStrategy(Domain domain, TrafficMatrix tm, LinkLoadComputerInvalidator changeListener)
          Creates a linkLoadStrategy object to compute load on the given domain from the given traffic matrix.
 
Method Summary
 LoadData detachData()
          Returns the data used by the link load computer and do not use it internally any more.
 boolean equals(java.lang.Object o)
          returns true if the LinkLoadComputer uses the same parameters as the object o.
 HybridLoadData getData()
          Returns hybrid data
 java.lang.String getShortName()
          Return a string representing the parameters in short.
 SPF getSPFAlgo()
          Get the SPF (Shortest Path First algorithm) property.
 java.util.List<TrafficMatrix> getTrafficMatrices()
          TODO: maybe change this to a set Returns the traffic matrix.
 int hashCode()
           
 boolean isECMP()
          Get the ECMP (Equal-Cost Multi-Path) property.
 void setECMP(boolean ECMP)
          Set the ECMP (Equal-Cost Multi-Path) property.
 void setSPFAlgo(SPF spf)
          Set the SPF (Shortest Path First algorithm) property.
 void setTm(TrafficMatrix tm)
          Sets a new traffic matrix to calculate load.
 java.lang.String toString()
           
 
Methods inherited from class be.ac.ulg.montefiore.run.totem.trafficMatrix.model.impl.AbstractLinkLoadComputer
addListener, dataChanged, destroy, getDomain, invalidate, isUpToDate, removeListener, setUptoDate, startListening, stopListening, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface be.ac.ulg.montefiore.run.totem.trafficMatrix.model.LinkLoadComputer
addListener, destroy, getDomain, invalidate, isUpToDate, recompute, removeListener, startListening, stopListening, update
 

Field Detail

ECMP

protected boolean ECMP

spf

protected SPF spf

tm

protected TrafficMatrix tm

data

protected SettableHybridLoadData data
Constructor Detail

AbstractLinkLoadStrategy

protected AbstractLinkLoadStrategy(Domain domain,
                                   TrafficMatrix tm)
Creates a linkLoadStrategy object to compute load on the given domain from the given traffic matrix. Sets the default property value : ECMP = false, stopOnError = true, spf = CSPF. Use the default LinkLoadComputerInvalidator (LinkLoadStrategyInvalidator).

Parameters:
domain -
tm -

AbstractLinkLoadStrategy

protected AbstractLinkLoadStrategy(Domain domain,
                                   TrafficMatrix tm,
                                   LinkLoadComputerInvalidator changeListener)
Creates a linkLoadStrategy object to compute load on the given domain from the given traffic matrix. Sets the default property value : ECMP = false, stopOnError = true, spf = CSPF. Use the given LinkLoadComputerInvalidator as invalidator.

Parameters:
domain -
tm -
changeListener -
Method Detail

setTm

public void setTm(TrafficMatrix tm)
Sets a new traffic matrix to calculate load. Also invalidate the data.

Specified by:
setTm in interface LinkLoadStrategy
Parameters:
tm -

detachData

public LoadData detachData()
Description copied from interface: LinkLoadComputer
Returns the data used by the link load computer and do not use it internally any more. After the data has been detached, the load has to be computed again by a call to LinkLoadComputer.recompute().

Specified by:
detachData in interface LinkLoadComputer
Returns:

getData

public HybridLoadData getData()
Returns hybrid data

Specified by:
getData in interface LinkLoadComputer
Returns:

isECMP

public boolean isECMP()
Get the ECMP (Equal-Cost Multi-Path) property.

By default : false

Specified by:
isECMP in interface LinkLoadStrategy
Returns:
true if equal-cost multi-path is activated and false otherwise

setECMP

public void setECMP(boolean ECMP)
Set the ECMP (Equal-Cost Multi-Path) property.

Specified by:
setECMP in interface LinkLoadStrategy
Parameters:
ECMP - true if equal-cost multi-path must be activated and false otherwise

getSPFAlgo

public SPF getSPFAlgo()
Get the SPF (Shortest Path First algorithm) property. The SPF is the routing algorithm used to compute the link load.

By default : dijkstra SPF implemented by the class CSPF.

Specified by:
getSPFAlgo in interface LinkLoadStrategy
Returns:
the SPF

setSPFAlgo

public void setSPFAlgo(SPF spf)
Set the SPF (Shortest Path First algorithm) property. The SPF is the routing algorithm used to compute the link load.

Specified by:
setSPFAlgo in interface LinkLoadStrategy
Parameters:
spf - the SPF to use in the link load computation

getShortName

public java.lang.String getShortName()
Description copied from interface: LinkLoadComputer
Return a string representing the parameters in short.

Specified by:
getShortName in interface LinkLoadComputer
Returns:

getTrafficMatrices

public java.util.List<TrafficMatrix> getTrafficMatrices()
Description copied from interface: LinkLoadComputer
TODO: maybe change this to a set Returns the traffic matrix.

Specified by:
getTrafficMatrices in interface LinkLoadComputer
Returns:

toString

public java.lang.String toString()
Specified by:
toString in interface LinkLoadStrategy
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Description copied from interface: LinkLoadComputer
returns true if the LinkLoadComputer uses the same parameters as the object o. (the computed data at a given moment are equivalent)

Specified by:
equals in interface LinkLoadComputer
Specified by:
equals in interface LinkLoadStrategy
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface LinkLoadComputer
Specified by:
hashCode in interface LinkLoadStrategy
Overrides:
hashCode in class java.lang.Object


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