|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgenerator_lib.GeneratorUtils
public class GeneratorUtils
The GeneratorUtils class assists the TraceGenerator driver program with the generation of users, file libraries, and transactions.
Field Summary | |
---|---|
private Globals |
GLOBALS
The Network parameterization object. |
private Network |
nw
The Network for which the generations are taking place. |
private double |
ZIPF_SUM
Sum of all file Zipf frequencies. |
Constructor Summary | |
---|---|
GeneratorUtils(Network network,
Globals GLOBALS)
Construct a GeneratorUtils object. |
Method Summary | |
---|---|
void |
generateInitLibs()
Generate/populate the initial file library. |
void |
generateUsers()
Generate/populate the User library. |
Transaction |
genTransactionNaive()
'Naively' generate a transaction. |
Transaction |
genTransactionSmart()
'Intelligently' generate a transaction. |
private int |
genUserType(User.Behavior model,
int quantity,
int prev)
Generate all users of a specified type, and place in library |
private double |
getZipf(int rank)
Return the Zipf frequency of a given file. |
private int |
inverseZipf(double weight)
Given an number on [0..ZIPF_SUM], map that value to a file identifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Network nw
private final Globals GLOBALS
private double ZIPF_SUM
Constructor Detail |
---|
public GeneratorUtils(Network network, Globals GLOBALS)
network
- The Network on which the utilities will operateGLOBALS
- The Network parameterization objectMethod Detail |
---|
public void generateUsers()
public void generateInitLibs()
public Transaction genTransactionSmart()
public Transaction genTransactionNaive()
private int genUserType(User.Behavior model, int quantity, int prev)
model
- The Behavior model of the generated usersquantity
- The number of users of this type to generateprev
- Identifier where first such user will be placed in User lib.
private double getZipf(int rank)
rank
- File number whose frequency is desired
private int inverseZipf(double weight)
weight
- Number on the [0..ZIPF_SUM] interval
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |