Util
Class RandomGenManager

java.lang.Object
  |
  +--Util.RandomGenManager

public final class RandomGenManager
extends java.lang.Object

The RandomGenManager (short for Random Number Generator Manager) handles all the independent random number generator streams a Model may require. Example, a Model may require a random generator for placing the nodes on the plane and an independent generator to connect the nodes, another to assign bandwidths etc. The RandomGenManger also provides a parsing routine to read from a seed file and methods to set the seed of each random number generator stream.

Each Model has one (and only one) RandomGenManager. See, for instance, Model.setRandomGenManager() method.


Constructor Summary
RandomGenManager()
           
 
Method Summary
static java.util.Random ASSIGN()
           
static java.util.Random BW()
           
static java.util.Random CONNECT_NODES()
           
static java.util.Random EDGE_CONN()
           
 void export(java.lang.String lastSeedFile, java.lang.String nextSeedFile)
          Export the seeds used to lastSeedFile.
 long getAssignSeed()
           
 long getBWSeed()
           
 long getConnectNodesSeed()
           
 long getEdgeConnSeed()
           
 long getGroupingSeed()
           
 long getPlaceNodesSeed()
           
static java.util.Random GROUPING()
           
 void parse(java.lang.String filename)
          Given a filename, parses the seeds of the various independent streams from the file.
static java.util.Random PLACE_NODES()
           
 void setAssignSeed(long seed)
          set the seed for the random stream used in BottomUpHierModel to determine how many routers are assigned to a specific AS
 void setBWSeed(long seed)
          set the seed for the random stream used to assign bandwidths to edges
 void setConnectNodesSeed(long seed)
          set the seed for the random stream used to connect nodes
 void setEdgeConnSeed(long seed)
          set the seed for the random stream used in TopDownHierModel for the Edge Connection method (i.e.
 void setGroupingSeed(long seed)
          set the seed for the random stream used in BottomUpHierModel to select routers go into a specifc AS
 void setPlaceNodesSeed(long seed)
          set the seed for the random stream used to place nodes on the plane
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomGenManager

public RandomGenManager()
Method Detail

parse

public void parse(java.lang.String filename)
Given a filename, parses the seeds of the various independent streams from the file. An example seedfile looks like:

PLACES 616734322540141     #to place nodes on the plane
CONNECT 41493274811023     #to connect nodes 
EDGE_CONN 43216394564736   #used in the edge connection method in TopDownHier model
GROUPING 39856906230034    #used when grouping routers into an AS, in BottomUpHier model
ASSIGNMENT 2603241246350  #used in BottomUpHierModel to decide how many routers each AS gets.
BANDWIDTH 107333601447040  #used to specify bandwidth to edges in a topology

export

public void export(java.lang.String lastSeedFile,
                   java.lang.String nextSeedFile)
Export the seeds used to lastSeedFile. (generally called "last_seed_file") Export the current state of the PRNG and to nextSeedFile so the next experiement can continue to use the independent streams (generally this file is called "seed_file")

getPlaceNodesSeed

public long getPlaceNodesSeed()

getConnectNodesSeed

public long getConnectNodesSeed()

getBWSeed

public long getBWSeed()

getEdgeConnSeed

public long getEdgeConnSeed()

getGroupingSeed

public long getGroupingSeed()

getAssignSeed

public long getAssignSeed()

PLACE_NODES

public static java.util.Random PLACE_NODES()

CONNECT_NODES

public static java.util.Random CONNECT_NODES()

BW

public static java.util.Random BW()

EDGE_CONN

public static java.util.Random EDGE_CONN()

GROUPING

public static java.util.Random GROUPING()

ASSIGN

public static java.util.Random ASSIGN()

setPlaceNodesSeed

public void setPlaceNodesSeed(long seed)
set the seed for the random stream used to place nodes on the plane

setConnectNodesSeed

public void setConnectNodesSeed(long seed)
set the seed for the random stream used to connect nodes

setBWSeed

public void setBWSeed(long seed)
set the seed for the random stream used to assign bandwidths to edges

setEdgeConnSeed

public void setEdgeConnSeed(long seed)
set the seed for the random stream used in TopDownHierModel for the Edge Connection method (i.e. connecting ASs)

setGroupingSeed

public void setGroupingSeed(long seed)
set the seed for the random stream used in BottomUpHierModel to select routers go into a specifc AS

setAssignSeed

public void setAssignSeed(long seed)
set the seed for the random stream used in BottomUpHierModel to determine how many routers are assigned to a specific AS