LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
wf_serial.m
1%% Serial Workflow Example
2% A simple workflow with three sequential activities.
3%
4% Workflow: A -> B -> C
5%
6% Copyright (c) 2012-2026, Imperial College London
7% All rights reserved.
8
9clear;
10lineStart;
11
12%% Define the workflow
13wf = Workflow('SerialWorkflow');
14
15% Add activities with exponential service times
16A = wf.addActivity('A', Exp.fitMean(1.0));
17B = wf.addActivity('B', Exp.fitMean(2.0));
18C = wf.addActivity('C', Exp.fitMean(1.5));
19
20% Define serial precedence
21wf.addPrecedence(Workflow.Serial(A, B, C));
22
23%% Convert to phase-type distribution
24ph = wf.toPH();
25
26%% Display results
27fprintf('Serial Workflow: A -> B -> C\n');
28fprintf('Activity means: A=1.0, B=2.0, C=1.5\n');
29fprintf('Expected total mean: %.2f\n', 1.0 + 2.0 + 1.5);
30fprintf('Computed PH mean: %.4f\n', ph.getMean());
31fprintf('Computed PH SCV: %.4f\n', ph.getSCV());
32fprintf('Number of phases: %d\n', size(ph.getSubgenerator(), 1));