How values are generated is determined by the mode
property.
Supported mode values are:
valuesFileURLmu mumu and
standard deviation = sigmamu every time.| Modifier and Type | Field and Description |
|---|---|
| public static final int | CONSTANT_MODE
Always return mu |
| public static final int | DIGEST_MODE
Use empirical distribution. |
| private EmpiricalDistribution | empiricalDistribution
Empirical probability distribution for use with DIGEST_MODE. |
| public static final int | EXPONENTIAL_MODE
Exponential random deviates with mean = μ. |
| private BufferedReader | filePointer
File pointer for REPLAY_MODE. |
| public static final int | GAUSSIAN_MODE
Gaussian random deviates with mean = μ, std dev = σ. |
| private int | mode
mode determines how values are generated. |
| private double | mu
Mean for use with non-data-driven modes. |
| private final RandomDataGenerator | randomData
Deprecated
as a consequence of RandomDataImpl to use for random data generation.
RandomDataGenerator being deprecated.
|
| public static final int | REPLAY_MODE
Replay data from valuesFilePath. |
| private double | sigma
Standard deviation for use with GAUSSIAN_MODE. |
| public static final int | UNIFORM_MODE
Uniform random deviates with mean = μ. |
| private URL | valuesFileURL
URI to raw data values. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ValueServer(RandomDataImpl
the RandomDataImpl instance used to source random data randomData)
Deprecated
use
ValueServer(RandomGenerator)
Construct a ValueServer instance using a RandomDataImpl as its source of random data. |
| public | ValueServer(RandomGenerator
source of random data generator)Construct a ValueServer instance using a RandomGenerator as its source of random data. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | computeDistribution()
Computes the empirical distribution using values from the file
in |
| public void | computeDistribution(int
the number of bins used in computing the empirical
distribution binCount)Computes the empirical distribution using values from the file
in |
| public void | fill(double[]
array to be filled values)Fills the input array with values generated using getNext() repeatedly. |
| public double[] | Returns: array of generated valueslength of output array length)Returns an array of length |
| public EmpiricalDistribution | Returns: EmpircalDistribution built bycomputeDistribution()Returns the |
| public int | |
| public double | Returns: Mean used in data generation.Returns the mean used when operating in |
| public double | Returns: generated valueReturns the next generated value, generated according to the mode value (see MODE constants). |
| private double | Returns: next random value from the empirical distribution digestGets a random value in DIGEST_MODE. |
| private double | Returns: random exponential valueGets an exponentially distributed random value with mean = mu. |
| private double | Returns: random Gaussian valueGets a Gaussian distributed random value with mean = mu and standard deviation = sigma. |
| private double | Returns: next value from the replay fileGets next sequential value from the |
| private double | Returns: random uniform valueGets a uniformly distributed random value with mean = mu. |
| public double | Returns: Standard deviation used when operating inGAUSSIAN_MODE.Returns the standard deviation used when operating in |
| public URL | Returns: Values file URL.Returns the URL for the file used to build the empirical distribution
when using |
| public void | reSeed(long
Value with which to reseed the seed)RandomDataImpl
used to generate random data.Reseeds the random data generator. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setValuesFileURL(String
String representation for new valuesFileURL. url)Sets the |
| public void |
| CONSTANT_MODE | back to summary |
|---|---|
| public static final int CONSTANT_MODE Always return mu | |
| DIGEST_MODE | back to summary |
|---|---|
| public static final int DIGEST_MODE Use empirical distribution. | |
| empiricalDistribution | back to summary |
|---|---|
| private EmpiricalDistribution empiricalDistribution Empirical probability distribution for use with DIGEST_MODE. | |
| EXPONENTIAL_MODE | back to summary |
|---|---|
| public static final int EXPONENTIAL_MODE Exponential random deviates with mean = μ. | |
| filePointer | back to summary |
|---|---|
| private BufferedReader filePointer File pointer for REPLAY_MODE. | |
| GAUSSIAN_MODE | back to summary |
|---|---|
| public static final int GAUSSIAN_MODE Gaussian random deviates with mean = μ, std dev = σ. | |
| mode | back to summary |
|---|---|
| private int mode mode determines how values are generated. | |
| mu | back to summary |
|---|---|
| private double mu Mean for use with non-data-driven modes. | |
| randomData | back to summary |
|---|---|
| private final RandomDataGenerator randomData
Deprecated as a consequence of RandomDataImpl to use for random data generation. | |
| REPLAY_MODE | back to summary |
|---|---|
| public static final int REPLAY_MODE Replay data from valuesFilePath. | |
| sigma | back to summary |
|---|---|
| private double sigma Standard deviation for use with GAUSSIAN_MODE. | |
| UNIFORM_MODE | back to summary |
|---|---|
| public static final int UNIFORM_MODE Uniform random deviates with mean = μ. | |
| valuesFileURL | back to summary |
|---|---|
| private URL valuesFileURL URI to raw data values. | |
| ValueServer | back to summary |
|---|---|
| public ValueServer() Creates new ValueServer | |
| ValueServer | back to summary |
|---|---|
| public ValueServer(RandomDataImpl randomData)
Deprecated Construct a ValueServer instance using a RandomDataImpl as its source of random data.
| |
| ValueServer | back to summary |
|---|---|
| public ValueServer(RandomGenerator generator) Construct a ValueServer instance using a RandomGenerator as its source of random data.
| |
| closeReplayFile | back to summary |
|---|---|
| public void closeReplayFile() throws IOException Closes
| |
| computeDistribution | back to summary |
|---|---|
| public void computeDistribution() throws IOException, ZeroException, NullArgumentException Computes the empirical distribution using values from the file
in
This method must be called before using
| |
| computeDistribution | back to summary |
|---|---|
| public void computeDistribution(int binCount) throws NullArgumentException, IOException, ZeroException Computes the empirical distribution using values from the file
in
This method must be called before using
| |
| fill | back to summary |
|---|---|
| public void fill(double[] values) throws IOException, MathIllegalStateException, MathIllegalArgumentException Fills the input array with values generated using getNext() repeatedly.
| |
| fill | back to summary |
|---|---|
| public double[] fill(int length) throws IOException, MathIllegalStateException, MathIllegalArgumentException Returns an array of length
| |
| getEmpiricalDistribution | back to summary |
|---|---|
| public EmpiricalDistribution getEmpiricalDistribution() Returns the
| |
| getMode | back to summary |
|---|---|
| public int getMode() Returns the data generation mode. See
| |
| getMu | back to summary |
|---|---|
| public double getMu() Returns the mean used when operating in
| |
| getNext | back to summary |
|---|---|
| public double getNext() throws IOException, MathIllegalStateException, MathIllegalArgumentException Returns the next generated value, generated according to the mode value (see MODE constants).
| |
| getNextDigest | back to summary |
|---|---|
| private double getNextDigest() throws MathIllegalStateException Gets a random value in DIGEST_MODE. Preconditions:
| |
| getNextExponential | back to summary |
|---|---|
| private double getNextExponential() throws MathIllegalArgumentException Gets an exponentially distributed random value with mean = mu.
| |
| getNextGaussian | back to summary |
|---|---|
| private double getNextGaussian() throws MathIllegalArgumentException Gets a Gaussian distributed random value with mean = mu and standard deviation = sigma.
| |
| getNextReplay | back to summary |
|---|---|
| private double getNextReplay() throws IOException, MathIllegalStateException Gets next sequential value from the Throws an IOException if the read fails.
This method will open the
The
| |
| getNextUniform | back to summary |
|---|---|
| private double getNextUniform() throws MathIllegalArgumentException Gets a uniformly distributed random value with mean = mu.
| |
| getSigma | back to summary |
|---|---|
| public double getSigma() Returns the standard deviation used when operating in
| |
| getValuesFileURL | back to summary |
|---|---|
| public URL getValuesFileURL() Returns the URL for the file used to build the empirical distribution
when using
| |
| reSeed | back to summary |
|---|---|
| public void reSeed(long seed) Reseeds the random data generator.
| |
| resetReplayFile | back to summary |
|---|---|
| public void resetReplayFile() throws IOException Resets REPLAY_MODE file pointer to the beginning of the
| |
| setMode | back to summary |
|---|---|
| public void setMode(int mode) Sets the data generation mode.
| |
| setMu | back to summary |
|---|---|
| public void setMu(double mu) Sets the
| |
| setSigma | back to summary |
|---|---|
| public void setSigma(double sigma) Sets the
| |
| setValuesFileURL | back to summary |
|---|---|
| public void setValuesFileURL(String url) throws MalformedURLException Sets the
| |
| setValuesFileURL | back to summary |
|---|---|
| public void setValuesFileURL(URL url) Sets the the The values file must be an ASCII text file containing one valid numeric entry per line.
| |