Package jline.lang.state
Class MatchingStation
java.lang.Object
jline.lang.state.MatchingStation
- All Implemented Interfaces:
Serializable
State-space helpers and event handler for a Matching (SchedStrategy.FCFM)
station, the FCFM stochastic matching model of Comte (2022). Port of the
MATLAB
State.matchingSpace, State.matchingPhases,
State.afterEventStationMatching and
solver_ctmc_matching_tput.
The local state is the ordered word of waiting jobs, oldest first, as
(class, patience phase) pairs (1-based), zero-padded to the capacity W,
followed by the V routing variables: [c_1 k_1 ... c_W k_W | vars].
The waiting classes always form an independent set of the compatibility
graph G (QueueNodeParam.compatibility).
- ARV (passive): a class-r arrival is matched with the OLDEST waiting job of a class s with G(r,s) = 1, which leaves the word; the arrival never enters. Both leave in the same transition, so no vanishing state arises. With no compatible job waiting the arrival is appended in a patience phase drawn from the initial vector of its patience law, or lost when the word holds W jobs.
- PHASE: a waiting class-r job moves between the transient phases of its phase-type patience (D0 off-diagonal).
- RENEGE: a waiting class-r job in phase k abandons at rate sum(D1(k,:)).
- DEP: none. Matched jobs leave inside the ARV transition; their
throughput is recovered from the stationary distribution by
matchingTput(jline.lang.NetworkStruct, int, jline.util.matrix.Matrix, double[]).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classPer-class rates at a Matching station: matched, accepted and reneging. -
Method Summary
Modifier and TypeMethodDescriptionstatic Ret.EventResultafterEvent(NetworkStruct sn, int ind, int ist, Matrix inspace, EventType event, int jobClass, int R, int V, boolean isSimulation) Successor states of a Matching station after event on class jobClass (0-based).static intcapacity(NetworkStruct sn, int ist) Capacity of station ist, or -1 when the station is uncapped.static boolean[][]compatibility(NetworkStruct sn, int ind) Compatibility graph of the Matching node ind (R x R, 0/1).static MatrixcountWaiting(NetworkStruct sn, int ind, Matrix state) Per-class waiting counts of each row of a Matching station's local state.static booleanhasPatience(NetworkStruct sn, int ist, int r) static booleanisMatching(NetworkStruct sn, int ist) True when the node at station ist is a Matching (FCFM) station.static MatchingStation.TputmatchingTput(NetworkStruct sn, int ist, Matrix space, double[] prob) Per-class rates at Matching station ist from the probabilities prob of the local states space (rows[c_1 k_1 ... c_W k_W ...], 1-based classes).static Matrix[]patienceProc(NetworkStruct sn, int ist, int r) static int[]phases(NetworkStruct sn, int ist, int r, boolean initialOnly) Patience phases (1-based) a waiting class-r job can be in: {1} without patience, otherwise 1..K, or only the phases with positive initial probability when initialOnly is true.static double[]Arrival rate of each class at the Source (0 when the class has none).static Matrixspace(NetworkStruct sn, int ind, Matrix n, boolean initialOnly) Local states of a Matching station with per-class waiting counts n (row vector).
-
Method Details
-
isMatching
True when the node at station ist is a Matching (FCFM) station. -
compatibility
Compatibility graph of the Matching node ind (R x R, 0/1). -
capacity
Capacity of station ist, or -1 when the station is uncapped. -
hasPatience
-
patienceProc
-
phases
Patience phases (1-based) a waiting class-r job can be in: {1} without patience, otherwise 1..K, or only the phases with positive initial probability when initialOnly is true. -
space
Local states of a Matching station with per-class waiting counts n (row vector). A count vector whose support is not an independent set of G, or that exceeds the capacity, has no state. With initialOnly only the patience phases a new job can start in are listed. An uncapped node has only the empty state (one zero pair), which is all SolverNC needs. -
countWaiting
Per-class waiting counts of each row of a Matching station's local state. -
afterEvent
public static Ret.EventResult afterEvent(NetworkStruct sn, int ind, int ist, Matrix inspace, EventType event, int jobClass, int R, int V, boolean isSimulation) Successor states of a Matching station after event on class jobClass (0-based). See the class comment for the event semantics. -
sourceRates
Arrival rate of each class at the Source (0 when the class has none). -
matchingTput
public static MatchingStation.Tput matchingTput(NetworkStruct sn, int ist, Matrix space, double[] prob) Per-class rates at Matching station ist from the probabilities prob of the local states space (rows[c_1 k_1 ... c_W k_W ...], 1-based classes). A class-r arrival finding a compatible job waiting adds its rate to the matched throughput of both classes.
-