Package qa.generator.distributions
Class QADistribution
java.lang.Object
qa.generator.distributions.QADistribution
- Direct Known Subclasses:
QACorrelatedSequence,QAFixed,QAGamma,QAGaussian,QARandomSpread
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract double[]createValues(int nValues) Generate a set of random values according to the underlying distribution.double[]getRange()Get the range of the distrubution.abstract double[]getRange(double nSigma) Get the range of the distrubution.final double[]getValues(int nValues) Create a set of random values according to the underlying distribution.booleanbooleanisSort()voidsetIntegrate(boolean integrate) voidsetSort(boolean sort)
-
Constructor Details
-
QADistribution
public QADistribution(boolean sort, boolean integrate) - Parameters:
sort- sort the data in ascending order.integrate- data will be integrated (e.g. to generate click times rather than inter-click intervals)
-
-
Method Details
-
getValues
public final double[] getValues(int nValues) Create a set of random values according to the underlying distribution.Concrete classes should override createValues rather than this getValues function, leaving getValues to sort and integrate as required
- Parameters:
nValues- number of values to generate.- Returns:
- array of values.
-
getRange
public abstract double[] getRange(double nSigma) Get the range of the distrubution. How this is defined is a little nebulous, for Guassian like distributions its the mean +/- n standard deviations.- Parameters:
nSigma- number of Standard Deviations (or equivalents).- Returns:
- The range of values.
-
getRange
public double[] getRange()Get the range of the distrubution. How this is defined is a little nebulous, for Guassian like distributions its the mean +/- n standard deviations.- Parameters:
nSDs- number of Standard Deviations (or equivalents).- Returns:
- The range of values.
-
createValues
protected abstract double[] createValues(int nValues) Generate a set of random values according to the underlying distribution.Do not sort or integrate within createValues, that wil be handled by the calling getValues function
- Parameters:
nValues- number of values to generate.- Returns:
- array of values.
-
isSort
public boolean isSort()- Returns:
- the sort
-
setSort
public void setSort(boolean sort) - Parameters:
sort- the sort to set
-
isIntegrate
public boolean isIntegrate()- Returns:
- the integrate
-
setIntegrate
public void setIntegrate(boolean integrate) - Parameters:
integrate- the integrate to set
-