Class NHPP
- All Implemented Interfaces:
Serializable,Copyable
The intensity is a step function of the wall clock: segment i
covers [breakpoints[i], breakpoints[i+1]) and carries rate
rates[i], so breakpoints has one more entry than
rates. With cyclic = true the schedule repeats, giving a
cyclic Poisson process.
Two horizon conventions:
- cyclic: the schedule repeats with period
T = breakpoints[n] - breakpoints[0]; the active segment at timetis found from(t - breakpoints[0]) mod T. - non-cyclic: the intensity is zero outside
[breakpoints[0], breakpoints[n]), so the process emits nothing once the schedule is exhausted. A non-cyclic NHPP is therefore a transient construct: run to steady state it converges to the empty system, and callers should use a time span within the horizon.
This is not a renewal process. Successive intervals are dependent,
because the position within the schedule carries over from one event to the
next. Accordingly the scalar summaries that presuppose an i.i.d. interval
distribution -- getSCV(), getSkewness(), evalCDF(double),
evalLST(double) -- are undefined here and return NaN rather than a
representative exponential value, which would silently misreport the process
as Poisson. The schedule itself is the parameterisation: read it with
getRateSchedule(). getMean() is well defined and returns the
arrival-stationary (Palm) mean interval 1/timeAverageRate.
The process representation stores:
getProcess().get(0)- 1x(n+1) matrix of breakpointsgetProcess().get(1)- 1xn matrix of ratesgetProcess().get(2)- 1x1 matrix, 1 if cyclic else 0
Solver support. Only the LDES simulation engine honours the exact schedule; every analytical solver rejects a model using it via the standard unsupported-feature check.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA piecewise-constant rate schedule: the parameterisation shared by every schedule-bearing process. -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleevalCDF(double t) Returns NaN; seegetSCV().doubleevalLST(double s) Returns NaN; seegetSCV().double[]Returns a copy of the segment breakpoints, length n+1.doublegetMean()Gets the mean (expected value) of this distribution.intReturns the number of segments in the schedule.doubleReturns the horizon length, which is the period when cyclic.Gets the process representation with actual distribution parameters.doublegetRateAt(double t) The rate in force at wall-clock timet; zero past a non-cyclic horizon.double[]getRates()Returns a copy of the per-segment rates, length n.Returns the rate schedule.doublegetSCV()Returns NaN: an NHPP is not a renewal process, so there is no i.i.d.doubleReturns NaN; seegetSCV().doubleReturns the time-average rate over the horizon,sum(rates[i]*width[i]) / sum(width[i]).booleanisCyclic()Whether the schedule repeats with periodgetPeriod().doublenextInterval(double from, double residual) Solvesintegral_{from}^{from+x} lambda(u) du = residualforx, walking the schedule forward and consuming the budget segment by segment.voidRestarts thesample(int, java.util.Random)clock at the start of the schedule.double[]Drawsnsuccessive interarrival times along one sample path.toString()Methods inherited from class jline.lang.processes.Distribution
evalProbInterval, getName, getNumParams, getParam, getRate, getSupport, getVar, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, mean, name, numParams, param, rate, sample, scv, setNumParams, setParam, skewness, support, var
-
Constructor Details
-
NHPP
public NHPP(double[] breakpoints, double[] rates, boolean cyclic) Creates an NHPP with a piecewise-constant intensity.- Parameters:
breakpoints- strictly increasing segment boundaries, length n+1rates- non-negative rate on each segment, length ncyclic- whether the schedule repeats with the horizon as period
-
NHPP
public NHPP(double[] breakpoints, double[] rates) Creates a cyclic NHPP.
-
-
Method Details
-
getBreakpoints
public double[] getBreakpoints()Returns a copy of the segment breakpoints, length n+1. -
getRates
public double[] getRates()Returns a copy of the per-segment rates, length n. -
isCyclic
public boolean isCyclic()Whether the schedule repeats with periodgetPeriod(). -
getNumSegments
public int getNumSegments()Returns the number of segments in the schedule. -
getPeriod
public double getPeriod()Returns the horizon length, which is the period when cyclic. -
getTimeAverageRate
public double getTimeAverageRate()Returns the time-average rate over the horizon,sum(rates[i]*width[i]) / sum(width[i]).For a cyclic schedule this is the long-run arrival rate. For a non-cyclic one it is the average over the active horizon only, since the intensity is zero afterwards.
-
getRateAt
public double getRateAt(double t) The rate in force at wall-clock timet; zero past a non-cyclic horizon. -
getRateSchedule
Returns the rate schedule. This is the parameterisation of the process; the scalar interval summaries are not. -
getMean
public double getMean()Description copied from class:DistributionGets the mean (expected value) of this distribution.- Specified by:
getMeanin classDistribution- Returns:
- the mean value
-
getSCV
public double getSCV()Returns NaN: an NHPP is not a renewal process, so there is no i.i.d. interval distribution for an SCV to summarise. Returning a representative value here would report a time-varying process as an exponential one to every consumer ofsn.scv.- Specified by:
getSCVin classDistribution- Returns:
- the squared coefficient of variation
-
getSkewness
public double getSkewness()Returns NaN; seegetSCV().- Specified by:
getSkewnessin classDistribution- Returns:
- the skewness value
-
evalCDF
public double evalCDF(double t) Returns NaN; seegetSCV().- 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) Returns NaN; seegetSCV().- Specified by:
evalLSTin classContinuousDistribution- Parameters:
s- the Laplace domain variable- Returns:
- the LST value at s
-
getProcess
Description copied from class:ContinuousDistributionGets the process representation with actual distribution parameters. Returns a MatrixCell containing the distribution parameters.- Specified by:
getProcessin classContinuousDistribution- Returns:
- MatrixCell with distribution-specific parameters
-
resetSampleClock
public void resetSampleClock()Restarts thesample(int, java.util.Random)clock at the start of the schedule. -
sample
Drawsnsuccessive interarrival times along one sample path.The intensity depends on absolute time, so this advances an internal clock across calls: consecutive samples form a realisation of the process starting at
breakpoints[0], not independent draws from a marginal. UseresetSampleClock()to restart the path. A non-cyclic schedule that runs out returns 0 for every remaining sample, the intensity there being zero.- Specified by:
samplein classDistribution- Parameters:
n- the number of samples to generaterandom- the random number generator to use- Returns:
- array of random samples
-
nextInterval
public double nextInterval(double from, double residual) Solvesintegral_{from}^{from+x} lambda(u) du = residualforx, walking the schedule forward and consuming the budget segment by segment. Returns 0 when a non-cyclic horizon is exhausted first, which callers read as "no further event".This is exact for an NHPP: conditional on no event since the last one, the residual is governed by the intensity from the current instant onward, so a holding time drawn under a rate that has since changed is not a sample from this process.
- Parameters:
from- wall-clock originresidual- an Exp(1) budget of cumulative intensity
-
toString
-