Class PHt

All Implemented Interfaces:
Serializable, Copyable

public class PHt extends ContinuousDistribution implements Serializable
Time-inhomogeneous phase-type distribution (Ph_t).

Following Ko and Pender, "Diffusion limits for the (MAP_t/Ph_t/inf)^N queueing network", Oper. Res. Lett. 45 (2017) 248-253, a Ph_t is an ordinary phase-type distribution whose initial vector and sub-generator are functions of the wall clock, alpha(t) and S(t), required only to be locally integrable. This class realises that definition with a piecewise-constant schedule: segment k covers [breakpoints[k], breakpoints[k+1]) and carries the pair (alpha[k], S[k]). The exit vector is s(t) = -S(t)e.

Because both the phase and the elapsed service depend on absolute time, a Ph_t service time is a function of the epoch at which service starts: sampleFrom(double, Random) is the operative sampler, and sample(int, Random) walks one path.

Like MAPt this does NOT extend Markovian, and the scalar summaries getSCV, getSkewness, evalCDF and evalLST return NaN, the distribution of a service time being different at every start epoch.

The MatrixCell layout is flat, [breakpoints, alpha_1..alpha_n, S_1..S_n, cyclic], each alpha stored as a 1-by-h row so that every element of the cell is a matrix.

See Also:
  • Constructor Details

    • PHt

      public PHt(double[] breakpoints, List<Matrix> alpha, List<Matrix> subgen, boolean cyclic)
      Creates a Ph_t with a piecewise-constant schedule.
      Parameters:
      breakpoints - strictly increasing segment boundaries, length n+1
      alpha - per-segment initial probability rows (1-by-h), length n
      subgen - per-segment sub-generators (h-by-h), length n
      cyclic - whether the schedule repeats with the horizon as period
    • PHt

      public PHt(double[] breakpoints, List<Matrix> alpha, List<Matrix> subgen)
      Creates a cyclic Ph_t.
  • Method Details

    • getBreakpoints

      public double[] getBreakpoints()
    • getAlphaSegments

      public List<Matrix> getAlphaSegments()
    • getSSegments

      public List<Matrix> getSSegments()
    • isCyclic

      public boolean isCyclic()
    • getNumSegments

      public int getNumSegments()
    • getNumberOfPhases

      public int getNumberOfPhases()
    • getPeriod

      public double getPeriod()
      Horizon length, which is the period when cyclic.
    • getSegmentIndexAt

      public int getSegmentIndexAt(double t)
      Index of the segment in force at t, or -1 past a non-cyclic horizon.
    • getAlphaAt

      public Matrix getAlphaAt(double t)
      alpha in force at t; the last segment's row past a non-cyclic horizon.
    • getSAt

      public Matrix getSAt(double t)
      S in force at t; the zero matrix past a non-cyclic horizon.
    • getTimeAverageProcessMAP

      public MatrixCell getTimeAverageProcessMAP()
      Width-weighted average nominal as a (D0, D1) MAP pair, D1 = s*alpha.

      A convex combination of sub-generators is a sub-generator and of probability vectors a probability vector, so the nominal is a valid phase-type; the fluid carrier reads it as the equivalent MAP.

    • getTimeAverageRate

      public double getTimeAverageRate()
      Completion rate of the time-averaged phase-type.

      A phase-type read as a MAP with D1 = s*alpha has arrival rate 1/mean, so the shared MAP routine answers this without a separate linear solve.

    • getRateAt

      public double getRateAt(double t)
      Completion rate of the phase-type in force at t; zero past a non-cyclic horizon.
    • getRateSchedule

      public PHt.RateSchedule getRateSchedule()
      The parameterisation of the process; the scalar summaries are not. Model compilation recognises a schedule-bearing process by this capability rather than by class name.
    • getMean

      public double getMean()
      Mean of the time-averaged phase-type.
      Specified by:
      getMean in class Distribution
      Returns:
      the mean value
    • getRate

      public double getRate()
      Description copied from class: Distribution
      Gets the rate of this distribution (inverse of mean).
      Overrides:
      getRate in class Distribution
      Returns:
      the rate value (1/mean)
    • getSCV

      public double getSCV()
      NaN: the service-time distribution differs at every start epoch, so there is no single i.i.d. law for an SCV to summarise.
      Specified by:
      getSCV in class Distribution
      Returns:
      the squared coefficient of variation
    • getSkewness

      public double getSkewness()
      NaN; see getSCV().
      Specified by:
      getSkewness in class Distribution
      Returns:
      the skewness value
    • evalCDF

      public double evalCDF(double t)
      NaN; see getSCV().
      Specified by:
      evalCDF in class Distribution
      Parameters:
      t - the point at which to evaluate the CDF
      Returns:
      the CDF value at point t
    • evalLST

      public double evalLST(double s)
      NaN; see getSCV().
      Specified by:
      evalLST in class ContinuousDistribution
      Parameters:
      s - the Laplace domain variable
      Returns:
      the LST value at s
    • getProcess

      public MatrixCell getProcess()
      Description copied from class: ContinuousDistribution
      Gets the process representation with actual distribution parameters. Returns a MatrixCell containing the distribution parameters.
      Specified by:
      getProcess in class ContinuousDistribution
      Returns:
      MatrixCell with distribution-specific parameters
    • resetSampleClock

      public void resetSampleClock()
      Restart the sample path at the schedule start.
    • sample

      public double[] sample(int n, Random random)
      Draws n successive service times along ONE sample path: sample i starts where sample i-1 completed, not at a fixed epoch.
      Specified by:
      sample in class Distribution
      Parameters:
      n - the number of samples to generate
      random - the random number generator to use
      Returns:
      array of random samples
    • sampleFrom

      public double sampleFrom(double t0, Random random)
      Service time for a job whose service starts at wall clock t0.

      Exact: within a segment the phase process is a homogeneous absorbing CTMC, and by the memoryless property the residual holding time may be redrawn at a breakpoint.

    • toString

      public String toString()
      Overrides:
      toString in class Object