Class MPHt

All Implemented Interfaces:
Serializable, Copyable

public class MPHt extends ContinuousDistribution implements Serializable
Time-inhomogeneous MARKED phase-type distribution (MPH_t).

An MPH whose three ingredients are functions of the wall clock: segment j covers [breakpoints[j], breakpoints[j+1]) and carries an entry law alpha_j, a sub-generator S_j and K exit vectors s_(1,j), ..., s_(K,j) satisfying the partition identity

  sum_c s_(c,j) = -S_j e
in every segment. This is to PHt what MPH is to PH.

It is STORED LOWERED to MMAPt form, segment by segment, by

  D0_j = S_j,   D1^(c)_j = s_(c,j) alpha_j
exactly as a PHt is stored as its equivalent MAPt pair. One marked schedule walk therefore serves both families and there is a single sn.proc shape behind ProcessType.isMarkedSchedule. The original (alpha, S, exits) are kept on the object for the getters and for serialization, so a round trip returns an MPHt and not the MMAPt it lowers to.

The lowering makes each segment's arrivals RENEWAL within that segment: D1^(c)_j factorises through alpha_j, so the phase after a completion does not depend on the phase before it. Across a breakpoint the process is still time-varying, which is what separates an MPH_t from an MPH.

At a Source the mark selects the class of the arriving job (Source.setMarkedArrival, sn.markidx). As a SERVICE process it is sampled for its duration and the mark is discarded, exactly as an MMAP is.

References: Q.-M. He, "The versatility of MMAP[K] and the MMAP[K]/G[K]/1 queue", Queueing Systems 38(4), 2001; Y. M. Ko and J. Pender, "Diffusion limits for the (MAP_t/Ph_t/inf)^N queueing network", Oper. Res. Lett. 45(3), 2017.

See Also:
  • Constructor Details

    • MPHt

      public MPHt(double[] breakpoints, List<Matrix> alpha, List<Matrix> S, List<List<Matrix>> exit, boolean cyclic)
      Creates an MPH_t with a piecewise-constant marked phase-type schedule.
      Parameters:
      breakpoints - strictly increasing segment boundaries, length n+1
      alpha - per-segment 1-by-h entry laws, length n
      S - per-segment h-by-h sub-generators, length n
      exit - the K mark exits, each a list of n per-segment h-by-1 vectors
      cyclic - whether the schedule repeats with the horizon as period
    • MPHt

      public MPHt(double[] breakpoints, List<Matrix> alpha, List<Matrix> S, List<List<Matrix>> exit)
      Creates a cyclic MPH_t.
  • Method Details

    • getBreakpoints

      public double[] getBreakpoints()
    • getAlphaSegments

      public List<Matrix> getAlphaSegments()
    • getSSegments

      public List<Matrix> getSSegments()
    • getExitSegments

      public List<Matrix> getExitSegments(int k)
      Per-segment exit vectors of one mark.
      Parameters:
      k - the 1-based mark index
      Returns:
      the n per-segment exit vectors
    • getExitSegments

      public List<List<Matrix>> getExitSegments()
      All exit vectors, mark-major: get(c).get(j) is mark c+1 in segment j.
    • getNumberOfTypes

      public int getNumberOfTypes()
    • 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.
    • toMMAPt

      public MMAPt toMMAPt()
      The equivalent MMAP_t, which is the form this process is stored and sampled in.
      Returns:
      the lowered marked schedule
    • toPHt

      public PHt toPHt()
      The UNMARKED schedule of the duration, PHt(alpha, S).
    • toMAPts

      public MAPt toMAPts(int k)
      The marginal schedule of one mark; see MMAPt.toMAPts(int).
    • getTimeAverageProcess

      public MatrixCell getTimeAverageProcess()
      Width-weighted average pair over the horizon, {D0bar, D1bar} of the lowered process.
    • getTimeAverageRate

      public double getTimeAverageRate()
      Arrival rate of the time-averaged aggregate MAP.
    • getTimeAverageMarkRates

      public double[] getTimeAverageMarkRates()
      Per-mark arrival rates of the time-averaged process; see MMAPt.
    • getMean

      public double getMean()
      Description copied from class: Distribution
      Gets the mean (expected value) of this distribution.
      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: an MPH_t is time-varying, so no i.i.d. interval law summarises it.
      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()
      The MMAPt-shaped cell of the lowering, which is what reaches sn.proc.

      The procid stays MPHT, so the featset gate and the wire type still tell the two families apart; only the representation is shared.

      Specified by:
      getProcess in class ContinuousDistribution
      Returns:
      MatrixCell with distribution-specific parameters
    • resetSampleClock

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

      public int getLastMark()
      The 1-based mark of the interval last returned by sample(int, Random).
    • sample

      public double[] sample(int n, Random random)
      Description copied from class: Distribution
      Generates random samples from this distribution using the specified random generator.
      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
    • sample

      public double[] sample(int n)
      Description copied from class: Distribution
      Generates random samples from this distribution using default random generator.
      Overrides:
      sample in class Distribution
      Parameters:
      n - the number of samples to generate
      Returns:
      array of random samples
    • nextArrival

      public double[] nextArrival(double from, int phase, Random random)
      Time to the next completion, the phase after it and its mark; see MMAPt.