1classdef Network < MNetwork
2 % Main queueing network model
class for LINE analysis
4 % Provides methods
for adding
nodes, job
classes, and links to create queueing networks.
6 % Copyright (c) 2012-2026, Imperial College London
10 methods (Access=
public)
12 function self = Network(name, varargin)
13 % NETWORK Create a
new queueing network model
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
20 % For compatibility, accepts but ignores the implementation argument.
21 % Always uses MNetwork (MATLAB) implementation
for optimal performance.
23 self@MNetwork(name); % Always use MNetwork
for performance
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.');
39 function model = cyclic(N, D, strategy, S)
40 % MODEL = CYCLIC(N, D, STRATEGY, S)
42 % Generates a cyclic queueing network
43 model = MNetwork.cyclic(N, D, strategy, S);
46 function model = tandem(lambda, D, strategy)
47 % MODEL = TANDEM(LAMBDA, D, STRATEGY)
49 % Generates a tandem queueing network
50 model = MNetwork.tandem(lambda, D, strategy);
53 function model = cluster(lambda, D, strategy, S, dispatching)
54 % MODEL = SERVERFARM(LAMBDA, D, STRATEGY, S, DISPATCHING)
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);
63 function model = clusterPs(lambda, D, dispatching)
64 % MODEL = SERVERFARMPS(LAMBDA, D, DISPATCHING)
66 % Open PS cluster with one server per queue
67 if nargin < 3, dispatching = RoutingStrategy.RAND; end
70 for i = 1:M, strategy{i} = SchedStrategy.PS; end
71 model = MNetwork.cluster(lambda, D, strategy, ones(M,1), dispatching);
74 function model = clusterFcfs(lambda, D, S, dispatching)
75 % MODEL = SERVERFARMFCFS(LAMBDA, D, S, DISPATCHING)
78 if nargin < 3 || isempty(S), S = ones(size(D,1),1); end
79 if nargin < 4, dispatching = RoutingStrategy.RAND; end
82 for i = 1:M, strategy{i} = SchedStrategy.FCFS; end
83 model = MNetwork.cluster(lambda, D, strategy, S, dispatching);
86 function model = clusterClosed(N, Z, D, strategy, S, dispatching)
87 % MODEL = SERVERFARMCLOSED(N, Z, D, STRATEGY, S, DISPATCHING)
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);