mapss.dif.csdf.sdf
Class SDFRandomGraphGenerator

java.lang.Object
  extended by mapss.dif.DIFRandomGraphGenerator
      extended by mapss.dif.csdf.sdf.SDFRandomGraphGenerator
Direct Known Subclasses:
SDFRandomTreeGenerator

public class SDFRandomGraphGenerator
extends DIFRandomGraphGenerator

Random graph generator in generating random SDF graphs. This class generates SDF graphs of random topology and production/consumption rates.

Version:
$Id: SDFRandomGraphGenerator.java 406 2007-05-10 14:27:07Z plishker $
Author:
Mingyung Ko

Field Summary
 
Fields inherited from class mapss.dif.DIFRandomGraphGenerator
_graph, _incidence, _reachability
 
Constructor Summary
SDFRandomGraphGenerator()
          Constructor with node count.
 
Method Summary
protected  void _initialize()
          Initialize the generator.
protected  void _makeRandomRates()
          Generate random rates for a given graph topology.
protected  void _reset(int nodeCount)
          Reset all configurations to generate a new random SDF graph.
 int getRepetitions(mocgraph.Node node)
          Get repetitions of the node.
 DIFGraph graph(int nodeCount)
          Generate a random acyclic SDF graph with the desired node count.
 void setMaxRate(int maxRate)
          Set the maximal production/consumption rate.
 void setOneProbability(int oneProbability)
          Set the probability of rate 1 for production/consumption.
 
Methods inherited from class mapss.dif.DIFRandomGraphGenerator
_initialize, _isIncident, _isReachable, _makeDAG, _randomNonNegativeInt, graph, graphs, setMaxFanIn, setMaxFanOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDFRandomGraphGenerator

public SDFRandomGraphGenerator()
Constructor with node count.

Method Detail

getRepetitions

public int getRepetitions(mocgraph.Node node)
Get repetitions of the node. The method has the same function as CSDFGraph.getRepetitions(Node). Because repetitions are also computed in the random graph generation process, they can be obtained without re-computation.

Parameters:
node - The node to get repetitions.
Returns:
The repetitions.

graph

public DIFGraph graph(int nodeCount)
Generate a random acyclic SDF graph with the desired node count.

Overrides:
graph in class DIFRandomGraphGenerator
Parameters:
nodeCount - The desired node count.
Returns:
The random graph in DIFGraph.

setMaxRate

public void setMaxRate(int maxRate)
Set the maximal production/consumption rate.

Parameters:
maxRate - The maximal rate.

setOneProbability

public void setOneProbability(int oneProbability)
Set the probability of rate 1 for production/consumption. Parameter probability should range from 0 to 1000.

Parameters:
oneProbability - The probability of rate 1.

_initialize

protected void _initialize()
Initialize the generator.

Overrides:
_initialize in class DIFRandomGraphGenerator

_makeRandomRates

protected void _makeRandomRates()
Generate random rates for a given graph topology.


_reset

protected void _reset(int nodeCount)
Reset all configurations to generate a new random SDF graph.

Overrides:
_reset in class DIFRandomGraphGenerator
Parameters:
nodeCount - The desired node count.