LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
QN2JSIMG.m
1function outputFileName = QN2JSIMG(model, outputFileName, options)
2% QN2JSIMG Writes a Network model to JMT JSIMG format
3%
4% OUTPUTFILENAME = QN2JSIMG(MODEL) exports the Network MODEL to a
5% temporary JSIMG file and returns the file path.
6%
7% OUTPUTFILENAME = QN2JSIMG(MODEL, OUTPUTFILENAME) exports to the
8% specified file path.
9%
10% OUTPUTFILENAME = QN2JSIMG(MODEL, OUTPUTFILENAME, OPTIONS) uses the
11% specified solver options for export configuration.
12%
13% Parameters:
14% model - Network model to export
15% outputFileName - Optional output file path (default: temp file)
16% options - Optional SolverOptions with simulation parameters
17%
18% Returns:
19% outputFileName - Path to the created JSIMG file
20%
21% Example:
22% model = Network('example');
23% % ... define model ...
24% fname = QN2JSIMG(model);
25% jsimgView(fname); % View in JMT
26%
27% See also: JMTIO, jsimgView
28%
29% Copyright (c) 2012-2026, Imperial College London
30% All rights reserved.
31
32if nargin < 2
33 outputFileName = [];
34end
35
36if nargin < 3
37 options = [];
38end
39
40% Create JMTIO instance with model and options
41jmtio = JMTIO(model, options);
42
43% Get network structure
44sn = model.getStruct(true);
45
46% Delegate to JMTIO writeJSIM
47outputFileName = jmtio.writeJSIM(sn, outputFileName);
48end