LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
oqn_nhpp.m
1% Open queueing network with an NHPP (cyclic) arrival process.
2%
3% NHPP is a non-homogeneous Poisson process with a piecewise-constant
4% intensity: segment i covers [breakpoints(i), breakpoints(i+1)) and carries
5% rate rates(i). With cyclic=true the schedule repeats with period
6% breakpoints(end)-breakpoints(1), giving a cyclic Poisson process. The LDES
7% simulation engine honours the exact schedule; SolverFLD honours it in
8% getTranAvg, where the intensity enters the closing fluid ODE as a
9% time-varying rate multiplier. Steady state is the time-average rate.
10
11model = Network('model');
12
13source = Source(model,'Source');
14queue = Queue(model, 'Queue', SchedStrategy.FCFS);
15sink = Sink(model,'Sink');
16
17jobclass = OpenClass(model, 'OpenClass', 0);
18
19% Rates 2,8,4 held for 3,1,2 time units, repeating cyclically.
20source.setArrival(jobclass, NHPP([0,3,4,6],[2,8,4],true));
21queue.setService(jobclass, Exp(10));
22
23model.link(Network.serialRouting(source,queue,sink));
24
25AvgTable{1} = LDES(model,'seed',1234,'samples',100000).getAvgTable;
26AvgTable{1}
27
28% Fluid transient over two periods: the queue throughput tracks lambda(t).
29solver = SolverFLD(model,'timespan',[0 12]);
30[~,~,TNt] = solver.getTranAvg();
31for t = [1.5 3.5 5.0 7.5 9.5 11.0]
32 fprintf('t=%5.2f lambda(t)=%6.3f queue Tput=%6.3f\n', t, ...
33 source.getArrivalProcess(jobclass).getRateAt(t), ...
34 interp1(TNt{2,1}.t, TNt{2,1}.metric, t));
35end
Definition Station.m:245