Model
Class Model

java.lang.Object
  |
  +--Model.Model
Direct Known Subclasses:
ASModel, BottomUpHierModel, FileModel, RouterModel, TopDownHierModel

public abstract class Model
extends java.lang.Object

All Topology generation in BRITE is governed by a Model Class. A Model is a member variable of every topology and knows how to generate a representative graph.

Class Model is the base abstract class from which all models in BRITE must be derived. For Router level models, consult the class RouterModel and for models at the AS level, see the ASModel class


Field Summary
protected  int connLocality
          Modeling Connection Locality.
protected  int growthType
          The growth method used when building the graph.
protected  int HS
          HS is the length of the plane (or number of unit size squares)
protected  int LS
          LS is the length of the inner squares in each HS square.
protected  int m
          m is the number of nodes each new node connects to
protected  int N
          N is the number of nodes in the topology generated by this model
protected  int nodePlacement
          The NodePlacement method used when placing nodes on the plane.
protected static java.util.HashSet nodePositions
          This is a static Hashset that tracks node collisions when placing nodes in the plane.
protected  int prefConn
          A notion of preferential connectivity.
protected  RandomGenManager rm
          Each model has one random number generator manager.
 
Constructor Summary
Model()
           
 
Method Summary
abstract  Graph Generate()
          All Models that are derived from this base Model class, must override the Generate() method.
 int getConnLocal()
           
 int getGrowthType()
          Get method used by a Model instance.
 int getM()
          Get the m parameter used by a Model instance.
 int getN()
          Get the number of nodes in a topology to be generated by a Model instance.
 int getNodePlacement()
          Get method used by a Model instance.
 int getPrefModel()
           
 void setRandomGenManager(RandomGenManager rm)
          Set the RandomGenManager for this Model.
abstract  java.lang.String toString()
          All models have a string description which is returned by their toString() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodePlacement

protected int nodePlacement
The NodePlacement method used when placing nodes on the plane. Currently, we support RANDOM and HEAVY TAILED placement of nodes. (values can be found in ModelConstants)

growthType

protected int growthType
The growth method used when building the graph. Do we grow incrementally or do we just place all the nodes at once and then create the edges. (i.e. GT_INCREMENTAL and GT_ALL respectively - values found in ModelConstants). More growth models can be added.

prefConn

protected int prefConn
A notion of preferential connectivity. Not implemented in any models included in this distribution.

connLocality

protected int connLocality
Modeling Connection Locality. Not implemented in any models included in this distribution

HS

protected int HS
HS is the length of the plane (or number of unit size squares)

LS

protected int LS
LS is the length of the inner squares in each HS square.

m

protected int m
m is the number of nodes each new node connects to

N

protected int N
N is the number of nodes in the topology generated by this model

rm

protected RandomGenManager rm
Each model has one random number generator manager. This RandomGenManager is usually created outside the Model and if specific seeds need to be used, it must be initialized at some point before generation via the setRandomGenManager() method. Also please see Util.RandomGenManager

nodePositions

protected static java.util.HashSet nodePositions
This is a static Hashset that tracks node collisions when placing nodes in the plane. It stores as keys a unique encoding of node (x,y) coordinates (found in Util.Util.Encode) and as values a true/false indicating if this coordinate is occupied by a node already. As such, verifying if a node is about to be collided with another node is an O(1) operation
Constructor Detail

Model

public Model()
Method Detail

setRandomGenManager

public void setRandomGenManager(RandomGenManager rm)
Set the RandomGenManager for this Model. Usually this is set by the creator of a Model, once the Model is successfully created. Each Model requires several independent random number streams - eg one for placing the nodes, one for connecting the nodes, one for assigning bandwidths etc. The RandomGenManager (found at Util.RandomGenManager) manages all these individual random number generators and their respective seeds. Each Model thus has one RandomGenManager, which is specific to this model only.
Parameters:
rm - The one RandomGenManager which manages the seeds and random number generators for this model.
See Also:
RandomGenManager

getNodePlacement

public int getNodePlacement()
Get method used by a Model instance. Your sub-class may extend this.
Returns:
int

getGrowthType

public int getGrowthType()
Get method used by a Model instance. Your sub-class may extend this.
Returns:
int

getPrefModel

public int getPrefModel()

getConnLocal

public int getConnLocal()

getN

public int getN()
Get the number of nodes in a topology to be generated by a Model instance.
Returns:
int

getM

public int getM()
Get the m parameter used by a Model instance.
Returns:
int

Generate

public abstract Graph Generate()
All Models that are derived from this base Model class, must override the Generate() method. The Generate() method handles all the model-specific intricacies of: 1) Placing the Nodes 2) Interconnecting the Nodes 3) Assigning Edge weights (bandwidth, delay etc) And other model-specific functionality.
Returns:
Graph

toString

public abstract java.lang.String toString()
All models have a string description which is returned by their toString() method. Usually this is included when exporting the topology generated by that model to a file.
Overrides:
toString in class java.lang.Object
Returns:
String