LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
Model.m
1classdef Model < Copyable
2 % Abstract parent class for all models in the LINE framework
3 %
4 % This class provides the basic structure and common functionality
5 % for all LINE model types. It maintains model metadata such as
6 % name, version, and attributes.
7 %
8 % Copyright (c) 2012-2026, Imperial College London
9 % All rights reserved.
10
11 properties (Hidden)
12 attribute; % Model attributes and metadata
13 lineVersion; % Version of LINE used to create the model
14 end
15
16 properties
17 name; % Name of the model
18 end
19
20 methods
21 function self = Model(name)
22 % Constructor: Creates a new Model instance
23 %
24 % Input:
25 % name - String name for the model
26 %
27 % Output:
28 % self - Model instance
29 %
30 % This constructor ensures LINE is properly initialized,
31 % sets the model name, and records the LINE version.
32
33 % Initialize LINE if not already done
34 if isempty(GlobalConstants.Verbose)
35 lineStart
36 end
37
38 % Set version and name
39 lineVersion = strtrim(GlobalConstants.Version);
40 self.setVersion(lineVersion);
41 self.setName(name);
42 end
43
44 function out = getName(self)
45 % Get the model name
46 %
47 % Output:
48 % out - String name of the model
49
50 out = self.name;
51 end
52
53 function self = setName(self, name)
54 % Set the model name
55 %
56 % Input:
57 % name - String name for the model
58 %
59 % Output:
60 % self - Updated Model instance
61
62 self.name = name;
63 end
64
65 function v = getVersion(self)
66 % Get the LINE version used to create this model
67 %
68 % Output:
69 % v - String version of LINE
70
71 v = self.lineVersion;
72 end
73
74 function self = setVersion(self, version)
75 % Set the LINE version for this model
76 %
77 % Input:
78 % version - String version of LINE
79 %
80 % Output:
81 % self - Updated Model instance
82
83 self.lineVersion = version;
84 end
85 end
86
87end