1%% Lu-Kumar Unstable Re-entrant Line Example
3% This script demonstrates the Lu-Kumar re-entrant line network, a classic
4% example showing that queueing networks can exhibit instability even when
5% individual station utilizations are below 100%.
7% The network has 2 stations and 4 job
classes:
8% - Jobs enter as Class 1, served at Station 1
9% - Switch to Class 2, served at Station 2
10% - Switch to Class 3, served at Station 2 (same station, different
class)
11% - Switch to Class 4, served at Station 1 (re-entry)
14% Key insight: Under FCFS, the network
is stable when utilization < 1.
15% Under certain priority policies (like giving priority to returning jobs),
16% the network can become unstable due to
virtual bottleneck effects.
19% Lu, S.H. and Kumar,
P.R. (1991),
"Distributed Scheduling Based on Due
20% Dates and Buffer Priorities", IEEE Trans. Automatic Control.
23fprintf(
'=== Lu-Kumar Re-entrant Line Example ===\n\n');
25%% Compare FCFS vs HOL Scheduling
26fprintf(
'Creating models with different scheduling strategies...\n');
28model_fcfs = gallery_lukumar_reentrant(
'FCFS');
29model_hol = gallery_lukumar_reentrant(
'HOL');
30model_ps = gallery_lukumar_reentrant(
'PS');
32%% Print network information
33fprintf(
'\nNetwork parameters:\n');
34fprintf(
' Arrival rate (lambda): 0.45\n');
35fprintf(
' Mean service time at Station 1 (Class 1): 1.0\n');
36fprintf(
' Mean service time at Station 2 (Class 2): 1.0\n');
37fprintf(
' Mean service time at Station 2 (Class 3): 1.0\n');
38fprintf(
' Mean service time at Station 1 (Class 4): 1.0\n');
39fprintf(
' Station 1 utilization: 0.90\n');
40fprintf(
' Station 2 utilization: 0.90\n\n');
42%% Solve with JMT (simulation)
43fprintf(
'Solving with JMT simulation...\n\n');
44options = lineDefaults;
49fprintf(
'--- FCFS Scheduling (Stable) ---\n');
50solver_fcfs = JMT(model_fcfs, options);
51AvgTable_fcfs = solver_fcfs.getAvgTable();
54%% HOL Priority Solution
55fprintf(
'\n--- HOL Priority Scheduling ---\n');
56fprintf(
'Priority: Class4 > Class1 at Station1, Class2 > Class3 at Station2\n');
57fprintf(
'(This priority policy can lead to instability in certain parameter regimes)\n\n');
58solver_hol = JMT(model_hol, options);
59AvgTable_hol = solver_hol.getAvgTable();
62%% PS Solution (
for comparison)
63fprintf(
'\n--- Processor Sharing (Stable) ---\n');
64solver_ps = JMT(model_ps, options);
65AvgTable_ps = solver_ps.getAvgTable();
69fprintf(
'\n=== Summary ===\n');
70fprintf(
'The Lu-Kumar network demonstrates that scheduling discipline matters!\n');
71fprintf(
'Even with station utilizations at 90%%, different scheduling policies\n');
72fprintf(
'can lead to dramatically different queue lengths and response times.\n\n');
73fprintf(
'Key observations:\n');
74fprintf(
'1. FCFS is always stable when utilization < 1 in open networks\n');
75fprintf(
'2. PS is also stable under the same conditions\n');
76fprintf(
'3. Priority policies can create "virtual bottlenecks" that cause\n');
77fprintf(
' queue buildup even when physical utilization is below 100%%\n');