Class MAPt

All Implemented Interfaces:
Serializable, Copyable

public class MAPt extends ContinuousDistribution implements Serializable
Time-inhomogeneous Markovian arrival process (MAP_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 MAP_t is an ordinary MAP whose two matrices are functions of the wall clock, D0(t) and D1(t), required only to be locally integrable. This class realises that definition with a piecewise-constant schedule, which is dense in L1_loc and is the form that serialises: segment k covers [breakpoints[k], breakpoints[k+1]) and carries the pair (D0[k], D1[k]), so breakpoints has one more entry than the matrix lists. D0 holds transition rates without an arrival, D1 the rates that generate one, and D0+D1 is a generator in every segment.

Two horizon conventions, as for NHPP: a cyclic schedule repeats with period breakpoints[n]-breakpoints[0]; a non-cyclic one is silent outside its horizon and is therefore a transient construct.

Setting h = 1 with D0 = -lambda_k and D1 = lambda_k recovers exactly the NHPP with the same breakpoints and rates.

This is neither a renewal process nor a time-homogeneous one, so the scalar summaries that presuppose an i.i.d. interval distribution -- getSCV, getSkewness, evalCDF, evalLST -- return NaN rather than a representative value that would misreport the process as stationary. The schedule is the parameterisation: read it with getRateSchedule().

The class deliberately does NOT extend Markovian. Code gated on isMarkovian reads getProcess as a single stationary (D0, D1) pair and would silently drop the schedule.

Constant support. The fluid solver expresses a segment as a per-entry multiplier on the time-averaged nominal, and that multiplier is undefined where the nominal entry is zero, so the constructor requires one sparsity pattern across segments.

The MatrixCell layout is flat, [breakpoints, D0_1..D0_n, D1_1..D1_n, cyclic], because a MatrixCell cannot nest; n follows from the length.

See Also:
  • Constructor Details

    • MAPt

      public MAPt(double[] breakpoints, List<Matrix> d0, List<Matrix> d1, boolean cyclic)
      Creates a MAP_t with a piecewise-constant matrix schedule.
      Parameters:
      breakpoints - strictly increasing segment boundaries, length n+1
      d0 - per-segment no-arrival rate matrices, length n
      d1 - per-segment arrival-generating rate matrices, length n
      cyclic - whether the schedule repeats with the horizon as period
    • MAPt

      public MAPt(double[] breakpoints, List<Matrix> d0, List<Matrix> d1)
      Creates a cyclic MAP_t.
  • Method Details

    • checkCommonSupport

      public static void checkCommonSupport(List<Matrix> mats, boolean ignoreDiagonal, String label)
      Rejects a schedule whose matrices do not share one sparsity pattern.

      The fluid solver expresses a segment as a per-entry multiplier on a nominal matrix, and that multiplier is undefined where the nominal entry is zero. Requiring one pattern is what makes the nominal nonzero wherever any segment is.

    • getBreakpoints

      public double[] getBreakpoints()
    • getD0Segments

      public List<Matrix> getD0Segments()
    • getD1Segments

      public List<Matrix> getD1Segments()
    • 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.
    • getD0At

      public Matrix getD0At(double t)
      D0 in force at t; the zero matrix past a non-cyclic horizon.
    • getD1At

      public Matrix getD1At(double t)
      D1 in force at t; the zero matrix past a non-cyclic horizon.
    • getTimeAverageProcess

      public MatrixCell getTimeAverageProcess()
      Width-weighted average (D0bar, D1bar) over the horizon.

      This is the nominal stationary MAP that carries the phase structure where a solver needs a time-homogeneous carrier. A convex combination of generators is a generator, so it is itself a valid MAP.

    • getTimeAverageRate

      public double getTimeAverageRate()
      Arrival rate of the time-averaged MAP. For h = 1 this is exactly the NHPP width-weighted average intensity.
    • getRateAt

      public double getRateAt(double t)
      Arrival rate of the MAP in force at t; zero past a non-cyclic horizon. This is the stationary rate of that segment, not the instantaneous conditional intensity, which depends on the current phase.
    • getRateSchedule

      public MAPt.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()
      Palm mean interval of the time-averaged MAP.
      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: a MAP_t is neither renewal nor time-homogeneous, so there is no i.i.d. interval distribution for an SCV to summarise. Returning the SCV of the time-averaged MAP would report a time-varying process as a stationary one to every consumer of sn.scv.
      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, in phase 1.
    • sample

      public double[] sample(int n, Random random)
      Draws n successive interarrival times along ONE sample path. Both the intensity and the phase depend on absolute time, so this advances an internal clock and phase across calls.
      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
    • nextArrival

      public double[] nextArrival(double from, int phase, Random random)
      Time to the next arrival from wall clock from in the given phase.

      Exact: within a segment the phase process is a homogeneous CTMC, and by the memoryless property the residual holding time may be redrawn at a breakpoint, so the boundary is crossed by advancing the clock and resampling under the new matrices.

      Returns:
      {interval, phase after the arrival}; interval 0 when a non-cyclic horizon is exhausted, which callers read as "no further arrival"
    • toString

      public String toString()
      Overrides:
      toString in class Object