org.apache.hadoop.tools.rumen
Class CDFRandomGenerator

java.lang.Object
  extended by org.apache.hadoop.tools.rumen.CDFRandomGenerator
Direct Known Subclasses:
CDFPiecewiseLinearRandomGenerator

public abstract class CDFRandomGenerator
extends Object

An instance of this class generates random values that confirm to the embedded LoggedDiscreteCDF . The discrete CDF is a pointwise approximation of the "real" CDF. We therefore have a choice of interpolation rules. A concrete subclass of this abstract class will implement valueAt(double) using a class-dependent interpolation rule.


Method Summary
protected  int floorIndex(double probe)
           
protected  long getDatumAt(int index)
           
protected  double getRankingAt(int index)
           
protected  void initializeTables(LoggedDiscreteCDF cdf)
           
 long randomValue()
           
abstract  long valueAt(double probability)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initializeTables

protected final void initializeTables(LoggedDiscreteCDF cdf)

floorIndex

protected int floorIndex(double probe)

getRankingAt

protected double getRankingAt(int index)

getDatumAt

protected long getDatumAt(int index)

randomValue

public long randomValue()

valueAt

public abstract long valueAt(double probability)


Copyright © 2009 The Apache Software Foundation