|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.totem.topgen.traffic.TrafficGenerator
TrafficGeneratorInterface
and subclasses instead.
public class TrafficGenerator
This class implements a traffic generator using the traffic models.
Creation date: 2004
Field Summary | |
---|---|
static int |
MAX_TRIALS
Deprecated. |
Constructor Summary | |
---|---|
TrafficGenerator(int ASID,
TrafficModel model,
double fraction)
Deprecated. |
|
TrafficGenerator(TrafficModel model,
RoutingMatrix matrix)
Deprecated. Initialises a newly created TrafficGenerator object. |
|
TrafficGenerator(TrafficModel model,
RoutingMatrix matrix,
double fraction)
Deprecated. Initialises a newly created TrafficGenerator object. |
Method Summary | |
---|---|
void |
generate()
Deprecated. generateTM() |
TrafficMatrix |
generateTM()
Deprecated. |
double |
getFraction()
Deprecated. Returns the fraction of the pairs of nodes that will generate traffic. |
IntPair |
getIds(int column)
Deprecated. |
int |
getKey(int src,
int dst)
Deprecated. |
double[] |
getLinkCounts()
Deprecated. Returns the link counts vector. |
RoutingMatrix |
getMatrix()
Deprecated. Returns the routing matrix of this traffic generator. |
double[] |
getTraffic()
Deprecated. Returns the generated traffic. |
boolean |
isGenerateOnlyEdgeTraffic()
Deprecated. Get the generateOnlyEdgeTraffic property value If generateOnlyEdgeTraffic is true, the generator generates traffic for nodes of type EDGE only otherwise it generates traffic for all pairs of nodes |
void |
setFraction(double fraction)
Deprecated. Sets the fraction of the pairs of nodes that will generate traffic. |
void |
setGenerateOnlyEdgeTraffic(boolean generateOnlyEdgeTraffic)
Deprecated. Set the generateOnlyEdgeTraffic property value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_TRIALS
Constructor Detail |
---|
public TrafficGenerator(int ASID, TrafficModel model, double fraction)
public TrafficGenerator(TrafficModel model, RoutingMatrix matrix)
TrafficGenerator
object. All
the pairs of nodes will generate traffic.
model
- The traffic model to be used.matrix
- The routing matrix to be used.public TrafficGenerator(TrafficModel model, RoutingMatrix matrix, double fraction)
TrafficGenerator
object.
model
- The traffic model to be used.matrix
- The routing matrix to be used.fraction
- The fraction of the pairs of nodes that must generate
traffic.
java.lang.IllegalArgumentException
- If fraction
is equal to or
lower than 0 or greater than 1.Method Detail |
---|
public final int getKey(int src, int dst)
public final IntPair getIds(int column)
public boolean isGenerateOnlyEdgeTraffic()
public void setGenerateOnlyEdgeTraffic(boolean generateOnlyEdgeTraffic)
generateOnlyEdgeTraffic
- public void generate() throws TrafficGenerationException
TopologyManager.getInstance().getDomain()
using
model
. This method ensures that the capacity of the links
is sufficient. If this is not the case, it regenerates traffic. If after
MAX_TRIALS, the method didn't arrive to generate traffic, it throws
a TrafficGenerationException
. Note that if fraction < 1
,
the pairs that generate traffic are selected randomly (using an uniform distribution).
TrafficGenerationException
public TrafficMatrix generateTM() throws InvalidDomainException, NodeNotFoundException, NoRouteToHostException, RoutingException, DataConsistencyException
InvalidDomainException
NodeNotFoundException
NoRouteToHostException
RoutingException
DataConsistencyException
public double getFraction()
public RoutingMatrix getMatrix()
public double[] getTraffic()
traffic
. traffic[i]
designates the traffic
between the pair of nodes i. The ids of the pair of nodes i can be
found using getMatrix().getIds(i)
.
java.lang.IllegalStateException
- If generate
was not called, or
if fraction
is too small.public double[] getLinkCounts()
java.lang.IllegalStateException
- If generate
was not called, or
if fraction
is too small.public void setFraction(double fraction)
java.lang.IllegalArgumentException
- If fraction
is equal to or
lower than 0 or greater than 1.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |