-
Notifications
You must be signed in to change notification settings - Fork 0
/
UASConfig.m
175 lines (152 loc) · 5.6 KB
/
UASConfig.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
classdef UASConfig < handle
%UASCONFIG Summary of this class goes here
% Detailed explanation goes here
properties
% The number of UAS
num_uas = 10
end
properties (Dependent)
speed_value
climb_value
hd_value
flex_value
end
properties (Access = protected)
speed_fn = []
speed_type = "CONSTANT"
m_speed_value = 1.0
climb_fn = []
climb_type = "CONSTANT"
m_climb_value = 1.0
hd_fn = []
hd_type = "CONSTANT"
m_hd_value = 10.0
flex_fn = []
flex_type = "CONSTANT"
m_flex_value = 0;
end
methods
function obj = UASConfig()
%UASCONFIG Construct an instance of this class
end
function s = get.speed_value(obj)
s = obj.m_speed_value;
end
function s = get.climb_value(obj)
s = obj.m_climb_value;
end
function s = get.hd_value(obj)
s = obj.m_hd_value;
end
function s = get.flex_value(obj)
s = obj.m_flex_value;
end
function setFlexMix(obj, type, value)
%setFlexMix Configure how this object sets uas headways
%
% On Input:
% type (string): type is either CONSTANT, UNIFORM, or
% GAUSSIAN
% value (float): for CONSTANT type, every uas has the same
% speed that is set to this value. For UNIFORM and GAUSSIAN
% type, this value represents the mean. By default the
% standard deviation is set to 1% of this value
if type == "UNIFORM" || type == "GAUSSIAN"
error("Not Implemented")
end
obj.m_flex_value = value;
end
function setHeadwayMix(obj, type, value)
%setHeadwayMix Configure how this object sets uas headways
%
% On Input:
% type (string): type is either CONSTANT, UNIFORM, or
% GAUSSIAN
% value (float): for CONSTANT type, every uas has the same
% speed that is set to this value. For UNIFORM and GAUSSIAN
% type, this value represents the mean. By default the
% standard deviation is set to 1% of this value
if type == "UNIFORM" || type == "GAUSSIAN"
error("Not Implemented")
end
obj.m_hd_value = value;
end
function setSpeedMix(obj, type, value)
%setSpeedMix Configure how this object sets uas speeds
%
% On Input:
% type (string): type is either CONSTANT, UNIFORM, or
% GAUSSIAN
% value (float): for CONSTANT type, every uas has the same
% speed that is set to this value. For UNIFORM and GAUSSIAN
% type, this value represents the mean. By default the
% standard deviation is set to 1% of this value
if type == "UNIFORM" || type == "GAUSSIAN"
error("Not Implemented")
end
obj.m_speed_value = value;
end
function setClimbRateMix(obj, type, value)
%setClimbRateMix Configure how this object sets uas climb rates
%
% On Input:
% type (string): type is either CONSTANT, UNIFORM, or
% GAUSSIAN
% value (float): for CONSTANT type, every uas has the same
% speed that is set to this value. For UNIFORM and GAUSSIAN
% type, this value represents the mean. By default the
% standard deviation is set to 1% of this value
if type == "UNIFORM" || type == "GAUSSIAN"
error("Not Implemented")
end
obj.m_climb_value = value;
end
function configureUAS(obj, uas)
if ~isa(uas, 'UAS')
error("uas argument must be object of class UAS");
end
obj.setUASSpeed(uas);
obj.setUASClimbRate(uas);
obj.setUASHeadway(uas);
obj.setUASFlex(uas);
end
end
methods (Access = protected)
function setUASSpeed(obj,uas)
%setUASSpeed Summary of this method goes here
% Detailed explanation goes here
if obj.speed_type == "CONSTANT"
uas.nominal_speed = obj.m_speed_value;
else
error("Not Implemented")
end
end
function setUASClimbRate(obj,uas)
%setUASSpeed Summary of this method goes here
% Detailed explanation goes here
if obj.climb_type == "CONSTANT"
uas.climb_rate = obj.m_climb_value;
else
error("Not Implemented")
end
end
function setUASHeadway(obj,uas)
%setUASHeadway Summary of this method goes here
% Detailed explanation goes here
if obj.hd_type == "CONSTANT"
uas.h_d = obj.m_hd_value;
else
error("Not Implemented")
end
end
function setUASFlex(obj,uas)
%setUASHeadway Summary of this method goes here
% Detailed explanation goes here
if obj.flex_type == "CONSTANT"
uas.flex = obj.m_flex_value;
else
error("Not Implemented")
end
end
end
end