LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
Network.m
1classdef Network < MNetwork
2 % Main queueing network model class for LINE analysis
3 %
4 % Provides methods for adding nodes, job classes, and links to create queueing networks.
5 %
6 % Copyright (c) 2012-2026, Imperial College London
7 % All rights reserved.
8
9 % PUBLIC METHODS
10 methods (Access=public)
11 %Constructor
12 function self = Network(name, varargin)
13 % NETWORK Create a new queueing network model
14 %
15 % @brief Creates a Network instance for queueing model construction
16 % @param name String identifier for the network model
17 % @param varargin Optional implementation parameter (ignored for performance)
18 % @return self Network instance ready for model construction
19 %
20 % For compatibility, accepts but ignores the implementation argument.
21 % Always uses MNetwork (MATLAB) implementation for optimal performance.
22
23 self@MNetwork(name); % Always use MNetwork for performance
24
25 % Parse optional implementation argument for compatibility
26 % but ignore it - always use MNetwork
27 if nargin >= 2 && ischar(varargin{1})
28 implementation = lower(varargin{1});
29 if strcmp(implementation, 'java') || strcmp(implementation, 'j') || strcmp(implementation, 'jnetwork')
30 warning('Network:JavaNotSupported', ...
31 'Java implementation requested but not supported in performance-optimized mode. Using MATLAB implementation.');
32 end
33 end
34 end
35 end
36
37 % STATIC METHODS
38 methods (Static)
39 function model = cyclic(N, D, strategy, S)
40 % MODEL = CYCLIC(N, D, STRATEGY, S)
41 %
42 % Generates a cyclic queueing network
43 model = MNetwork.cyclic(N, D, strategy, S);
44 end
45
46 function model = tandem(lambda, D, strategy)
47 % MODEL = TANDEM(LAMBDA, D, STRATEGY)
48 %
49 % Generates a tandem queueing network
50 model = MNetwork.tandem(lambda, D, strategy);
51 end
52
53 function model = cluster(lambda, D, strategy, S, dispatching)
54 % MODEL = SERVERFARM(LAMBDA, D, STRATEGY, S, DISPATCHING)
55 %
56 % Generates an open server-farm queueing network:
57 % Source -> Dispatcher (Router) -> Server[1..M] -> Sink
58 if nargin < 4 || isempty(S), S = ones(size(D,1),1); end
59 if nargin < 5, dispatching = RoutingStrategy.RAND; end
60 model = MNetwork.cluster(lambda, D, strategy, S, dispatching);
61 end
62
63 function model = clusterPs(lambda, D, dispatching)
64 % MODEL = SERVERFARMPS(LAMBDA, D, DISPATCHING)
65 %
66 % Open PS cluster with one server per queue
67 if nargin < 3, dispatching = RoutingStrategy.RAND; end
68 M = size(D,1);
69 strategy = cell(M,1);
70 for i = 1:M, strategy{i} = SchedStrategy.PS; end
71 model = MNetwork.cluster(lambda, D, strategy, ones(M,1), dispatching);
72 end
73
74 function model = clusterFcfs(lambda, D, S, dispatching)
75 % MODEL = SERVERFARMFCFS(LAMBDA, D, S, DISPATCHING)
76 %
77 % Open FCFS cluster
78 if nargin < 3 || isempty(S), S = ones(size(D,1),1); end
79 if nargin < 4, dispatching = RoutingStrategy.RAND; end
80 M = size(D,1);
81 strategy = cell(M,1);
82 for i = 1:M, strategy{i} = SchedStrategy.FCFS; end
83 model = MNetwork.cluster(lambda, D, strategy, S, dispatching);
84 end
85
86 function model = clusterClosed(N, Z, D, strategy, S, dispatching)
87 % MODEL = SERVERFARMCLOSED(N, Z, D, STRATEGY, S, DISPATCHING)
88 %
89 % Generates a closed server-farm queueing network:
90 % Think (Delay) -> Dispatcher (Router) -> Server[1..M] -> Think
91 if nargin < 5 || isempty(S), S = ones(size(D,1),1); end
92 if nargin < 6, dispatching = RoutingStrategy.RAND; end
93 model = MNetwork.clusterClosed(N, Z, D, strategy, S, dispatching);
94 end
95 end
96end
Definition mmt.m:124