-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathWCV_TAUMOD_SUM.h
238 lines (168 loc) · 8.77 KB
/
WCV_TAUMOD_SUM.h
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/*
* Copyright (c) 2015-2021 United States Government as represented by
* the National Aeronautics and Space Administration. No copyright
* is claimed in the United States under Title 17, U.S.Code. All Other
* Rights Reserved.
*/
#ifndef WCV_TAUMOD_SUM_H_
#define WCV_TAUMOD_SUM_H_
#include "WCV_TAUMOD.h"
#include "DaidalusParameters.h"
#include <string>
namespace larcfm {
class WCV_TAUMOD_SUM : public WCV_TAUMOD {
public:
/** Constructor that a default instance of the WCV tables. */
WCV_TAUMOD_SUM();
WCV_TAUMOD_SUM(const std::string& id, const WCVTable& table);
WCV_TAUMOD_SUM(const WCV_TAUMOD_SUM& wcv);
virtual ~WCV_TAUMOD_SUM() {}
/**
* @return one static WCV_TAUMOD_SUM
*/
static const WCV_TAUMOD_SUM& A_WCV_TAUMOD_SUM();
/**
* @return DO-365 Phase I (en-route) preventive thresholds, i.e., DTHR=0.66nmi, ZTHR=700ft,
* TTHR=35s, TCOA=0, with SUM
*/
static const WCV_TAUMOD_SUM& DO_365_Phase_I_preventive();
/**
* @return DO-365 Well-Clear thresholds Phase I (en-route), i.e., DTHR=0.66nmi, ZTHR=450ft,
* TTHR=35s, TCOA=0, with SUM
*/
static const WCV_TAUMOD_SUM& DO_365_DWC_Phase_I();
/**
* @return DO-365 Well-Clear thresholds Phase II (DTA), i.e., DTHR=1500 [ft], ZTHR=450ft,
* TTHR=0s, TCOA=0, with SUM
*/
static const WCV_TAUMOD_SUM& DO_365_DWC_Phase_II();
/**
* @return DO-365 Well-Clear thresholds Non-Cooperative, i.e., DTHR=2200 [ft], ZTHR=450ft,
* TTHR=0s, TCOA=0.
*/
static const WCV_TAUMOD_SUM& DO_365_DWC_Non_Coop();
virtual ConflictData conflictDetectionWithTrafficState(const TrafficState& ownship, const TrafficState& intruder,
double B, double T) const;
private:
double h_pos_z_score_; // Number of horizontal position standard deviations
bool h_pos_z_score_enabled_; // True if value has been set independently. Otherwise,
// value will be overwritten using global parameter
double h_vel_z_score_min_; // Minimum number of horizontal velocity standard deviations
bool h_vel_z_score_min_enabled_; // True if value has been set independently. Otherwise,
// value will be overwritten using global parameter
double h_vel_z_score_max_; // Maximum number of horizontal velocity standard deviations
bool h_vel_z_score_max_enabled_; // True if value has been set independently. Otherwise,
// value will be overwritten using global parameter
double h_vel_z_distance_; // Distance at which h_vel_z_score scales from min to max as range decreases
std::string h_vel_z_distance_units_; // Units of distance at which h_vel_z_score scales from min to max as range decreases
bool h_vel_z_distance_enabled_; // True if value has been set independently. Otherwise,
// value will be overwritten using global parameter
double v_pos_z_score_; // Number of vertical position standard deviations
bool v_pos_z_score_enabled_; // True if value has been set independently. Otherwise,
// value will be overwritten using global parameter
double v_vel_z_score_; // Number of vertical velocity standard deviations
bool v_vel_z_score_enabled_; // True if value has been set independently. Otherwise,
// value will be overwritten using global parameter
static double MinError;
void initSUM();
void copyFrom(const WCV_TAUMOD_SUM& wcv);
bool sumof(const Vect2& v1, const Vect2& v2, const Vect2& w) const;
Vect2 average_direction(const Vect2& v1, const Vect2& v2) const;
std::pair<Vect2,Vect2> optimal_pair(const Vect2& v1, const Vect2& v2, const Vect2& w1, const Vect2& w2) const;
std::pair<Vect2,Vect2> optimal_wcv_pair_comp_init(const Vect2& v1, const Vect2& v2, double s_err, double v_err) const;
std::pair<Vect2,Vect2> optimal_wcv_pair(const Vect2& s, const Vect2& v, double s_err, double v_err, int eps1, int eps2) const;
bool horizontal_wcv_taumod_uncertain(const Vect2& s, const Vect2& v, double s_err, double v_err) const;
bool vertical_WCV_uncertain(double sz, double vz, double sz_err, double vz_err) const;
double horizontal_wcv_taumod_uncertain_entry(const Vect2& s, const Vect2& v, double s_err, double v_err, double T) const;
double Theta_D_uncertain(const Vect2& s, const Vect2& v, double s_err, double v_err, int eps) const;
double horizontal_wcv_taumod_uncertain_exit(const Vect2& s, const Vect2& v,double s_err, double v_err, double T) const;
LossData horizontal_wcv_taumod_uncertain_interval(const Vect2& s, const Vect2& v,double s_err, double v_err, double T) const;
LossData vertical_WCV_uncertain_full_interval_szpos_vzpos(double T, double minsz/*,double maxsz*/, double minvz/*, double maxvz*/) const;
LossData vertical_WCV_uncertain_full_interval_szpos_vzneg(double T, double minsz,double maxsz, double minvz, double maxvz) const;
LossData vertical_WCV_uncertain_full_interval_szpos(double T, double minsz,double maxsz, double minvz, double maxvz) const;
LossData vertical_WCV_uncertain_full_interval_split(double T, double minsz,double maxsz, double minvz, double maxvz) const;
LossData vertical_WCV_uncertain_interval(double B, double T, double sz, double vz, double sz_err, double vz_err) const;
bool containsSUM(const WCV_TAUMOD_SUM& wcv) const;
double relativeHorizontalPositionError(const TrafficState& own, const TrafficState& ac) const;
double relativeVerticalPositionError(const TrafficState& own, const TrafficState& ac) const;
double weighted_z_score(double range) const;
double relativeHorizontalSpeedError(const TrafficState& own, const TrafficState& ac, double s_err) const;
double relativeVerticalSpeedError(const TrafficState& own, const TrafficState& ac) const;
public:
WCV_TAUMOD_SUM & operator=(const WCV_TAUMOD_SUM& wcv);
virtual Detection3D* make() const;
/**
* Returns a deep copy of this WCV_TAUMOD object, including any results that have been calculated.
*/
virtual Detection3D* copy() const;
virtual std::string getSimpleClassName() const;
bool WCV_taumod_uncertain(const Vect3& s, const Vect3& v, double s_err, double sz_err, double v_err, double vz_err) const;
LossData WCV_taumod_uncertain_interval(double B, double T, const Vect3& s, const Vect3& v,
double s_err, double sz_err, double v_err, double vz_err) const;
bool WCV_taumod_uncertain_detection(double B, double T, const Vect3& s, const Vect3& v,
double s_err, double sz_err, double v_err, double vz_err) const;
virtual bool contains(const Detection3D& cd) const;
void updateParameterData(ParameterData& p) const;
void setParameters(const ParameterData& p);
/**
* @return get z-score (number of standard deviations) for horizontal position
*/
double getHorizontalPositionZScore() const;
/**
* @return set z-score (number of standard deviations) for horizontal position (non-negative value)
*/
void setHorizontalPositionZScore(double val);
/**
* @return get min z-score (number of standard deviations) for horizontal velocity
*/
double getHorizontalVelocityZScoreMin() const;
/**
* @return set min z-score (number of standard deviations) for horizontal velocity (non-negative value)
*/
void setHorizontalVelocityZScoreMin(double val);
/**
* @return get max z-score (number of standard deviations) for horizontal velocity
*/
double getHorizontalVelocityZScoreMax() const;
/**
* @return set max z-score (number of standard deviations) for horizontal velocity (non-negative value)
*/
void setHorizontalVelocityZScoreMax(double val);
/**
* @return Distance (in internal units) at which h_vel_z_score scales from min to max as range decreases
*/
double getHorizontalVelocityZDistance() const;
/**
* @return Set distance (in internal units) at which h_vel_z_score scales from min to max as range decreases
*/
void setHorizontalVelocityZDistance(double val);
/**
* @return Distance (in given units) at which h_vel_z_score scales from min to max as range decreases
*/
double getHorizontalVelocityZDistance(const std::string& u) const;
/**
* @return Set distance (in given units) at which h_vel_z_score scales from min to max as range decreases
*/
void setHorizontalVelocityZDistance(double val, const std::string& u);
/**
* @return get z-score (number of standard deviations) for vertical position
*/
double getVerticalPositionZScore() const;
/**
* @return set z-score (number of standard deviations) for vertical position (non-negative value)
*/
void setVerticalPositionZScore(double val);
/**
* @return get z-score (number of standard deviations) for vertical velocity
*/
double getVerticalSpeedZScore() const;
/**
* @return set z-score (number of standard deviations) for vertical velocity (non-negative value)
*/
void setVerticalSpeedZScore(double val);
std::string toString() const;
std::string toPVS() const;
void set_global_SUM_parameters(const DaidalusParameters& p);
};
}
#endif