Class Replayer
- All Implemented Interfaces:
Serializable,Copyable
- Direct Known Subclasses:
Trace
The Replayer distribution reads real-world trace data from files and reproduces the exact sequence of observations. This is essential for trace-driven simulation, workload characterization, and model validation against real data patterns.
Key capabilities:
- Reading trace data from text files (one value per line)
- Sequential replay of empirical observations
- Empirical CDF computation from trace data
- Statistical moment calculation (mean, variance, skewness)
- Support for both file paths and direct data arrays
Common applications include reproducing real arrival processes, service time patterns, and validating analytical models against measurements from production systems.
- Since:
- 1.0
- See Also:
-
ReplayerNodeParamEmpiricalCDF- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleevalCDF(double t) Evaluates the cumulative distribution function (CDF) at the given point.doubleevalLST(double s) Evaluate the Laplace-Stieltjes Transform at sfitAPH()double[]getData()Returns the raw data array backing this Replayer distribution.doublegetMean()Gets the mean (expected value) of this distribution.doublegetRate()Gets the rate of this distribution (inverse of mean).doublegetSCV()Gets the squared coefficient of variation (SCV) of this distribution.doubleGets the skewness of this distribution.doublegetVar()Gets the variance of this distribution.isNHPP()Test whether the trace is a sample path of a NON-HOMOGENEOUS POISSON process, by the conditional-uniform KS test with the Lewis refinement (InferNhppKs.infer_nhpp_ks(double[], double)).double[]sample(int n) Generates random samples from this distribution using default random generator.double[]Generates random samples from this distribution using the specified random generator.Methods inherited from class jline.lang.processes.Distribution
evalLST, evalProbInterval, getFeatureName, getName, getNumParams, getNumParams, getParam, getParam, getParams, getSupport, hasParam, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, mean, name, numParams, param, rate, scv, setNumParams, setParam, skewness, support, var
-
Constructor Details
-
Replayer
-
-
Method Details
-
evalCDF
public double evalCDF(double t) Description copied from class:DistributionEvaluates the cumulative distribution function (CDF) at the given point.- Specified by:
evalCDFin classDistribution- Parameters:
t- the point at which to evaluate the CDF- Returns:
- the CDF value at point t
-
evalLST
public double evalLST(double s) Description copied from class:DistributionEvaluate the Laplace-Stieltjes Transform at s- Specified by:
evalLSTin classDistribution- Parameters:
s- the Laplace domain variable- Returns:
- the LST value at s
-
fitAPH
-
getFileName
-
getMean
public double getMean()Description copied from class:DistributionGets the mean (expected value) of this distribution.- Specified by:
getMeanin classDistribution- Returns:
- the mean value
-
getRate
public double getRate()Description copied from class:DistributionGets the rate of this distribution (inverse of mean).- Overrides:
getRatein classDistribution- Returns:
- the rate value (1/mean)
-
getSCV
public double getSCV()Description copied from class:DistributionGets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2.- Specified by:
getSCVin classDistribution- Returns:
- the squared coefficient of variation
-
getSkewness
public double getSkewness()Description copied from class:DistributionGets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.- Specified by:
getSkewnessin classDistribution- Returns:
- the skewness value
-
getVar
public double getVar()Description copied from class:DistributionGets the variance of this distribution. Computed as SCV * mean^2.- Overrides:
getVarin classDistribution- Returns:
- the variance
-
getData
public double[] getData()Returns the raw data array backing this Replayer distribution.- Returns:
- the trace data as a double array
-
isNHPP
Test whether the trace is a sample path of a NON-HOMOGENEOUS POISSON process, by the conditional-uniform KS test with the Lewis refinement (InferNhppKs.infer_nhpp_ks(double[], double)).WHY THE QUESTION IS WORTH ASKING. A Replayer is used wherever a measured stream is fed to a solver, and every analytical method that consumes it as an arrival process assumes SOMETHING about its dependence structure. This test says whether the Poisson assumption -- independent increments, whatever the rate does with time -- survives contact with the data, which is the assumption a time-varying analysis (SolverFluid's 'mtginf', 'mol', 'tvms') rests on. A small p-value says the stream is not Poisson at any rate function, so those methods are answering a different process.
The trace holds INTER-ARRIVAL times, so the arrival epochs are their cumulative sum and the horizon is the last of them.
- Returns:
- the map of infer_nhpp_ks: statistic, pvalue and n
-
sample
public double[] sample(int n) Description copied from class:DistributionGenerates random samples from this distribution using default random generator.- Overrides:
samplein classDistribution- Parameters:
n- the number of samples to generate- Returns:
- array of random samples
-
sample
Description copied from class:DistributionGenerates random samples from this distribution using the specified random generator.- Specified by:
samplein classDistribution- Parameters:
n- the number of samples to generaterandom- the random number generator to use- Returns:
- array of random samples
-