be.ac.ulg.montefiore.run.totem.topgen.traffic
Class AbstractTrafficGenerator

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.topgen.traffic.AbstractTrafficGenerator
All Implemented Interfaces:
TrafficGeneratorInterface
Direct Known Subclasses:
AbstractDistributionTrafficGenerator, ConstantTrafficGenerator

public abstract class AbstractTrafficGenerator
extends java.lang.Object
implements TrafficGeneratorInterface

Traffic generator that can generate a specified number of matrices. Each matrix is routable thanks to SPF. A matrix that is not routable is computed again with a maximum number of times given by the maxTrials parameter.

Creation date: 29/10/2007

Author:
Gaƫl Monfort (monfort@run.montefiore.ulg.ac.be)

Field Summary
protected  Domain domain
           
protected  java.util.List<Node> nodes
           
protected  java.util.HashMap<java.lang.String,java.lang.String> parameters
           
protected static java.util.ArrayList<ParameterDescriptor> params
           
 
Constructor Summary
AbstractTrafficGenerator()
           
 
Method Summary
protected abstract  TrafficMatrix buildTM()
          Build a TrafficMatrix.
protected  ParameterDescriptor findParam(java.lang.String name)
           
 java.util.List<TrafficMatrix> generate()
          Generate a traffic matric based on the paremeters.
 java.util.List<ParameterDescriptor> getAvailableParameters()
          Returns a list of parameters that can be used with the generator.
 java.lang.String getParam(java.lang.String name)
          get the value of the specified parameter.
protected abstract  void initialize_generation()
          Initialize the generation of traffic matrices.
 void setParam(java.lang.String name, java.lang.String value)
          set user parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

params

protected static final java.util.ArrayList<ParameterDescriptor> params

parameters

protected java.util.HashMap<java.lang.String,java.lang.String> parameters

domain

protected Domain domain

nodes

protected java.util.List<Node> nodes
Constructor Detail

AbstractTrafficGenerator

public AbstractTrafficGenerator()
Method Detail

findParam

protected ParameterDescriptor findParam(java.lang.String name)

setParam

public void setParam(java.lang.String name,
                     java.lang.String value)
              throws InvalidParameterException
Description copied from interface: TrafficGeneratorInterface
set user parameters.

Specified by:
setParam in interface TrafficGeneratorInterface
Parameters:
name - name of the parameter.
value - value of the parameter.
Throws:
InvalidParameterException - If the parameter is invalid.

getParam

public java.lang.String getParam(java.lang.String name)
                          throws InvalidParameterException
Description copied from interface: TrafficGeneratorInterface
get the value of the specified parameter.

Specified by:
getParam in interface TrafficGeneratorInterface
Parameters:
name - name of the parameter.
Returns:
the value of the parameter.
Throws:
InvalidParameterException - If the parameter is invalid.

generate

public java.util.List<TrafficMatrix> generate()
                                       throws TrafficGenerationException
Generate a traffic matric based on the paremeters. The method initialize_generation() is called at first, Then method buildTM() is called for each matrix generation.

Specified by:
generate in interface TrafficGeneratorInterface
Returns:
Throws:
TrafficGenerationException

buildTM

protected abstract TrafficMatrix buildTM()
                                  throws TMBuildingException
Build a TrafficMatrix.

Returns:
Throws:
TMBuildingException

initialize_generation

protected abstract void initialize_generation()
                                       throws InvalidParameterException
Initialize the generation of traffic matrices. Should fetch class specific parameters and prepare the data structures.

Throws:
InvalidParameterException

getAvailableParameters

public java.util.List<ParameterDescriptor> getAvailableParameters()
Description copied from interface: TrafficGeneratorInterface
Returns a list of parameters that can be used with the generator.

Specified by:
getAvailableParameters in interface TrafficGeneratorInterface
Returns:


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