WSF
MTT.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSF_MTT_HPP
13#define WSF_MTT_HPP
14
15#include <map>
16#include <string>
17
18#include "MTT_ActiveTrack.hpp"
19class MTT_Measurement;
20#include "MTT_Parameters.hpp"
22#include "MTT_Tracks.hpp"
24class MTT_Parameters;
25class MTT_Track;
26
27#include "UtMatrix.hpp"
28class UtInput;
29
30class WsfPlatform;
31class WsfTrackId;
32class WsfTrackManager;
33class WsfMTT_CSV_EventOutput;
34class WsfMTT_EventOutput;
37
47
48class MTT
49{
50public:
51 MTT();
52 MTT(const MTT& aSrc);
53 MTT& operator=(const MTT&) = delete;
54 ~MTT() = default;
55
56 MTT* Clone() const { return new MTT(*this); }
57
58 bool ProcessInput(UtInput& aInput); // for general configuration
59
60 WsfMTT_Interface* GetInterface() const { return mMTT_InterfacePtr; }
61
62 MTT_Tracks& GetTracks() // meant to be non-const.
63 {
64 return mTracks;
65 }
66
67 const MTT_Parameters& GetParameters() const { return mParameters; }
68
69 MTT_Parameters& GetParameters() // non-const version
70 {
71 return mParameters;
72 }
73
74 void SetParameters(const MTT_Parameters& aParameters) { mParameters = aParameters; }
75
76 // void SetDebug(bool aDebug) { mDebug = aDebug; }
77
78 // void SetName(const std::string& aName) { mName = aName; } // To be used in debug output.
79
80 void SetTrackManager(WsfTrackManager* aTrackManager);
81
82 void SaveData(MTT_PerceivedCluster* aNonLocalTrackPtr, MTT_ActiveTrack::Data* aTempData, MTT_ActiveTrack* aLocalTrackPtr);
83
84 bool RemoveSavedData(int aMTT_TrackId,
85 MTT_PerceivedCluster*& aNonLocalTrackPtr, // out
86 MTT_ActiveTrack::Data*& aTempData,
87 MTT_ActiveTrack*& aLocalTrackPtr); // out
88
89 // Methods converted from FORTRAN
90 // Individually converted mtt routines
91 // The following two methods are extracted from the mtttfs method
92 MTT_ActiveTrack* MTT_Correlate(double aSimTime,
93 const MTT_PerceivedCluster& aNonlocalTrack,
94 MTT_ActiveTrack::Data& aTempActiveData);
95
96 void MTT_Fuse(double aSimTime,
97 const MTT_PerceivedCluster& aNonlocalTrack,
98 MTT_ActiveTrack& aLocalTrack,
99 MTT_ActiveTrack::Data& aTempActiveData);
100
101 void mttc2a(const MTT_CandidateTrack::Data& aCandidateTrackData, MTT_ActiveTrack::Data& aActiveTrackData, bool& aError);
102
103 MTT_ActiveTrack* mttcat(double aSimTime, const MTT_PerceivedCluster& aMeasurement);
104
105 int mttcct(double aSimTime,
106 const MTT_PerceivedCluster& aMeasurement,
107 MTT_ActiveTrack*& aActiveTrackPtr); // in/out; nonzero if correlated.
108
109 void mttpvf(const UtMatrixd& aVerticalCovariance, // 2x2 (covar, not info?)
110 MTT_Track& aCandidateTrack);
111
112 void mttdps_Correlation(const double& aSimTime,
113 const MTT_PerceivedCluster& aMeasurement,
114 MTT_ActiveTrack*& aTrackPtr); // out
115
116 void mttdps_Fusion(const double& aSimTime,
117 const MTT_PerceivedCluster& aMeasurement,
118 MTT_ActiveTrack* aTrackPtr); // out
119
120 void mttet(double aSimTime, const MTT_PerceivedCluster& aMeasurement);
121
122 void mttgtm(const MTT_ActiveTrack::Data& aActiveTrackData,
123 const MTT_Track& aTrackHeader,
124 const MTT_Measurement& aMeasurement,
125 const double& aDT,
126 double& aHypothesisTestValue, // out
127 double& aInnovationValue); // out
128
129 void mttgtt(const MTT_ActiveTrack::Data& aActiveTrackData,
130 const MTT_ActiveTrack::Data& aTempActiveTrackData,
131 double aDt,
132 double& aTestValue,
133 double& aInnovationValue);
134
135 void mttlfp(double aDt, UtMatrixd& aCovarianceMatrix, UtMatrixd& aStateVector);
136
137 void mttlfm(UtMatrixd& aStraightFlightStateVector,
138 UtMatrixd& aStraightFlightErrorCovarianceMatrix,
139 const UtMatrixd& aVerticalErrorCovarianceMatrix,
140 const UtMatrixd& aVerticalFlightInformationState,
141 const MTT_Track& aTrack,
142 const MTT_Measurement& aMeasurement,
143 double aDt,
144 double& aStraightFlightLikelihood);
145
146 void mttlfq(const UtMatrixd& aStraightFlightState,
147 const UtMatrixd& aStraightFlightErrorCovariance,
148 const UtMatrixd& aVerticalErrorCovariance,
149 const UtMatrixd& aVerticalFlightState,
150 const MTT_Track& aTrack,
151 const MTT_Measurement& aMeasurement,
152 double aDT,
153 double& aHypothesisTestValue, // out
154 double& aInnovationValue); // out
155
156 void mtttfe(const MTT_PerceivedCluster& aMeasurement,
157 const MTT_ActiveTrack::Data& aUpdateData, // mst387
158 MTT_Track& aTrack, // ptr384
159 double aUpdateInterval,
160 double aSimTime);
161
162 void mttflf(UtMatrixd& aFilterStates, // in/out
163 UtMatrixd& aHorizontalInfo, // in/out
164 const UtMatrixd& aFilterStatesUpdate,
165 const UtMatrixd& aHorizontalInfoUpdate,
166 const UtMatrixd& aPrevFilterStates,
167 const UtMatrixd& aPrevHorizInfoMatrix,
168 double aDt,
169 double& aLikelihoodValue); // out
170
171 void mttftf(UtMatrixd& aFilterStates, // in/out
172 UtMatrixd& aHorizontalInfo, // in/out
173 const UtMatrixd& aFilterStatesUpdate,
174 const UtMatrixd& aHorizontalInfoUpdate,
175 const UtMatrixd& aPrevFilterStates,
176 const UtMatrixd& aPrevHorizInfoMatrix,
177 double aDt,
178 double& aLikelihoodValue); // out
179
180 void mtttfm(UtMatrixd& aTurningFlightStateVector,
181 UtMatrixd& aTurningFlightErrorCovarianceMatrix,
182 const UtMatrixd& aVerticalErrorCovarianceMatrix,
183 const UtMatrixd& aVerticalFlightInformationState,
184 const MTT_Track& aTrack,
185 const MTT_Measurement& aMeasurement,
186 double aDt,
187 double& aTurningFlightLikelihood);
188
189 void mtttfp(double aDt, UtMatrixd& aCovarianceMatrix, UtMatrixd& aStateVector);
190
191 void mtttfq(const UtMatrixd& aTurningFlightState,
192 const UtMatrixd& aTurningFlightErrorCovariance,
193 const UtMatrixd& aVerticalErrorCovariance,
194 const UtMatrixd& aVerticalFlightState,
195 const MTT_Track& aTrack,
196 const MTT_Measurement& aMeasurement,
197 const double& aDT,
198 double& aHypothesisTestValue, // out
199 double& aInnovationValue); // out
200
201 void mtttfs_Correlation(double aSimTime,
202 const MTT_PerceivedCluster& aNonlocalTrack,
203 MTT_ActiveTrack::Data& aTempActiveData,
204 MTT_ActiveTrack*& aLocalTrackPtr);
205
206 void mtttfs_Fusion(double aSimTime,
207 const MTT_PerceivedCluster& aNonlocalTrack,
208 MTT_ActiveTrack::Data& aTempActiveData,
209 MTT_ActiveTrack*& aLocalTrackPtr);
210
211 void mttuat(double aSimTime, const MTT_PerceivedCluster& aNonLocalTrack, MTT_Track& aActiveTrack);
212
213 void mttuhf(double aSimTime, const MTT_PerceivedCluster& aMeasurement, MTT_ActiveTrack*& aTrackPtr);
214
215 void mttuhi(double aDt,
216 const UtMatrixd& aHorizontalAcceleration, // 2x1
217 UtMatrixd& aHorizontalInfoMatrix, // 4x4
218 UtMatrixd& aHorizontalState, // 4x1
219 const UtMatrixd& aConnectionMatrix, // 2x4
220 const UtMatrixd& aConnectionMatrixTranspose, // 4x2
221 const UtMatrixd& aDxDyCovariance, // 2x2
222 double aSensorLocationX,
223 double aSensorLocationY,
224 double aDx,
225 double aDy,
226 int aTrackType);
227
228 void mttuvi(double aDt,
229 const UtMatrixd& aVerticalInfoFilter, // 2x1, W
230 UtMatrixd& aVerticalInfoMatrix, // 2x2, PI
231 UtMatrixd& aVerticalState, // 2x1, XI
232 const UtMatrixd& aVerticalCandidateInfoFilter, // 2x2, RINV
233 double aSensorLocationZ, // RDRZ
234 double aTargetLocationZ, // DZ
235 unsigned aRangeValid, // IRNG
236 unsigned aElevationValid, // IEL
237 int aTrackType); // TRKTYP
238
239 void mttuvp(double aDt,
240 const UtMatrixd& aVerticalInfoFilter, // 2x1, W
241 UtMatrixd& aVerticalInfoMatrix, // 2x2, PI
242 UtMatrixd& aVerticalState, // 2x1, XI
243 int aTrackType); // TRKTYP
244
245 void mttalt(const MTT_ActiveTrack* aLocalTrackPtr,
246 double& aAlt); // out
247
249
250private:
251 WsfMTT_Interface* mMTT_InterfacePtr;
252 MTT_Parameters mParameters;
253 MTT_Tracks mTracks;
254 bool mDebug;
255 std::string mName;
256 WsfTrackManager* mManagerPtr;
257
258 // Misc options not covered by MTT_Parameters
259 bool mCorrelateAllSources;
260
261 struct SavedData // Between correlation and fusion calls
262 {
263 MTT_PerceivedCluster* mNonLocalTrackPtr;
264 MTT_ActiveTrack::Data* mTempDataPtr;
265 MTT_ActiveTrack* mLocalTrackPtr;
266 };
267
268 using TrackIdToSavedDataMap = std::map<int, SavedData>;
269 TrackIdToSavedDataMap mTrackIdToSavedDataMap;
270};
271
272#endif
Definition MTT_ActiveTrack.hpp:31
Corresponds with Suppressor block 387.
Definition MTT_ActiveTrack.hpp:28
Definition MTT_CandidateTrack.hpp:27
Definition MTT_Measurement.hpp:20
Definition MTT_Parameters.hpp:19
This is a representation of a Suppressor perceived cluster (block 17).
Definition MTT_PerceivedCluster.hpp:27
Definition MTT_Track.hpp:22
Definition MTT_Tracks.hpp:23
bool ProcessInput(UtInput &aInput)
Definition MTT.cpp:73
void mttftf(UtMatrixd &aFilterStates, UtMatrixd &aHorizontalInfo, const UtMatrixd &aFilterStatesUpdate, const UtMatrixd &aHorizontalInfoUpdate, const UtMatrixd &aPrevFilterStates, const UtMatrixd &aPrevHorizInfoMatrix, double aDt, double &aLikelihoodValue)
Definition MTT.cpp:1969
void mttlfm(UtMatrixd &aStraightFlightStateVector, UtMatrixd &aStraightFlightErrorCovarianceMatrix, const UtMatrixd &aVerticalErrorCovarianceMatrix, const UtMatrixd &aVerticalFlightInformationState, const MTT_Track &aTrack, const MTT_Measurement &aMeasurement, double aDt, double &aStraightFlightLikelihood)
Definition MTT.cpp:2670
void mtttfs_Correlation(double aSimTime, const MTT_PerceivedCluster &aNonlocalTrack, MTT_ActiveTrack::Data &aTempActiveData, MTT_ActiveTrack *&aLocalTrackPtr)
Definition MTT.cpp:4600
void SetParameters(const MTT_Parameters &aParameters)
Definition MTT.hpp:74
int mttcct(double aSimTime, const MTT_PerceivedCluster &aMeasurement, MTT_ActiveTrack *&aActiveTrackPtr)
Definition MTT.cpp:552
void MTT_Fuse(double aSimTime, const MTT_PerceivedCluster &aNonlocalTrack, MTT_ActiveTrack &aLocalTrack, MTT_ActiveTrack::Data &aTempActiveData)
Top-level fusion method.
Definition MTT.cpp:202
void mttet(double aSimTime, const MTT_PerceivedCluster &aMeasurement)
Multiple target tracking - update embryonic tracks.
Definition MTT.cpp:1225
void mttuhf(double aSimTime, const MTT_PerceivedCluster &aMeasurement, MTT_ActiveTrack *&aTrackPtr)
Multiple target tracking - update height filter.
Definition MTT.cpp:5451
MTT * Clone() const
Definition MTT.hpp:56
void mtttfp(double aDt, UtMatrixd &aCovarianceMatrix, UtMatrixd &aStateVector)
Definition MTT.cpp:4105
MTT_Parameters & GetParameters()
Definition MTT.hpp:69
void SetTrackManager(WsfTrackManager *aTrackManager)
Called from MTT_Fusion/MTT_Correlation during initialization.
Definition MTT.cpp:58
void mttpvf(const UtMatrixd &aVerticalCovariance, MTT_Track &aCandidateTrack)
Definition MTT.cpp:3411
MTT_Tracks & GetTracks()
Definition MTT.hpp:62
void mttgtt(const MTT_ActiveTrack::Data &aActiveTrackData, const MTT_ActiveTrack::Data &aTempActiveTrackData, double aDt, double &aTestValue, double &aInnovationValue)
Definition MTT.cpp:2260
void mttlfp(double aDt, UtMatrixd &aCovarianceMatrix, UtMatrixd &aStateVector)
Definition MTT.cpp:2966
void mttc2a(const MTT_CandidateTrack::Data &aCandidateTrackData, MTT_ActiveTrack::Data &aActiveTrackData, bool &aError)
Multiple target tracking - promote candidate track.
Definition MTT.cpp:244
void mtttfe(const MTT_PerceivedCluster &aMeasurement, const MTT_ActiveTrack::Data &aUpdateData, MTT_Track &aTrack, double aUpdateInterval, double aSimTime)
Definition MTT.cpp:3487
const MTT_Parameters & GetParameters() const
Definition MTT.hpp:67
MTT_ActiveTrack * MTT_Correlate(double aSimTime, const MTT_PerceivedCluster &aNonlocalTrack, MTT_ActiveTrack::Data &aTempActiveData)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition MTT.cpp:158
void mttdps_Correlation(const double &aSimTime, const MTT_PerceivedCluster &aMeasurement, MTT_ActiveTrack *&aTrackPtr)
Multiple target tracking - detection processing system (correlation).
Definition MTT.cpp:1016
MTT_ActiveTrack * mttcat(double aSimTime, const MTT_PerceivedCluster &aMeasurement)
Multiple target tracking - check active track.
Definition MTT.cpp:373
void mttuat(double aSimTime, const MTT_PerceivedCluster &aNonLocalTrack, MTT_Track &aActiveTrack)
Multiple target tracking - update an active track.
Definition MTT.cpp:5171
void mttuvi(double aDt, const UtMatrixd &aVerticalInfoFilter, UtMatrixd &aVerticalInfoMatrix, UtMatrixd &aVerticalState, const UtMatrixd &aVerticalCandidateInfoFilter, double aSensorLocationZ, double aTargetLocationZ, unsigned aRangeValid, unsigned aElevationValid, int aTrackType)
Multiple target tracking - update vertical info filter.
Definition MTT.cpp:5793
void mttlfq(const UtMatrixd &aStraightFlightState, const UtMatrixd &aStraightFlightErrorCovariance, const UtMatrixd &aVerticalErrorCovariance, const UtMatrixd &aVerticalFlightState, const MTT_Track &aTrack, const MTT_Measurement &aMeasurement, double aDT, double &aHypothesisTestValue, double &aInnovationValue)
Definition MTT.cpp:3057
MTT & operator=(const MTT &)=delete
WsfPerfectCorrelation mHF_Correlator
Definition MTT.hpp:248
void mtttfs_Fusion(double aSimTime, const MTT_PerceivedCluster &aNonlocalTrack, MTT_ActiveTrack::Data &aTempActiveData, MTT_ActiveTrack *&aLocalTrackPtr)
Definition MTT.cpp:5121
void mttdps_Fusion(const double &aSimTime, const MTT_PerceivedCluster &aMeasurement, MTT_ActiveTrack *aTrackPtr)
Multiple target tracking - detection processing system (fusion).
Definition MTT.cpp:1144
void mtttfq(const UtMatrixd &aTurningFlightState, const UtMatrixd &aTurningFlightErrorCovariance, const UtMatrixd &aVerticalErrorCovariance, const UtMatrixd &aVerticalFlightState, const MTT_Track &aTrack, const MTT_Measurement &aMeasurement, const double &aDT, double &aHypothesisTestValue, double &aInnovationValue)
Definition MTT.cpp:4225
void SaveData(MTT_PerceivedCluster *aNonLocalTrackPtr, MTT_ActiveTrack::Data *aTempData, MTT_ActiveTrack *aLocalTrackPtr)
Save temporary data from the correlation step, that is needed for fusion.
Definition MTT.cpp:105
void mttuvp(double aDt, const UtMatrixd &aVerticalInfoFilter, UtMatrixd &aVerticalInfoMatrix, UtMatrixd &aVerticalState, int aTrackType)
Multiple target tracking - update vertical info filter.
Definition MTT.cpp:5860
void mttflf(UtMatrixd &aFilterStates, UtMatrixd &aHorizontalInfo, const UtMatrixd &aFilterStatesUpdate, const UtMatrixd &aHorizontalInfoUpdate, const UtMatrixd &aPrevFilterStates, const UtMatrixd &aPrevHorizInfoMatrix, double aDt, double &aLikelihoodValue)
Definition MTT.cpp:1793
~MTT()=default
void mttgtm(const MTT_ActiveTrack::Data &aActiveTrackData, const MTT_Track &aTrackHeader, const MTT_Measurement &aMeasurement, const double &aDT, double &aHypothesisTestValue, double &aInnovationValue)
Multiple target tracking - measurement to trk gate test.
Definition MTT.cpp:2145
void mtttfm(UtMatrixd &aTurningFlightStateVector, UtMatrixd &aTurningFlightErrorCovarianceMatrix, const UtMatrixd &aVerticalErrorCovarianceMatrix, const UtMatrixd &aVerticalFlightInformationState, const MTT_Track &aTrack, const MTT_Measurement &aMeasurement, double aDt, double &aTurningFlightLikelihood)
Definition MTT.cpp:3809
void mttalt(const MTT_ActiveTrack *aLocalTrackPtr, double &aAlt)
Definition MTT.cpp:5988
MTT()
Definition MTT.cpp:31
bool RemoveSavedData(int aMTT_TrackId, MTT_PerceivedCluster *&aNonLocalTrackPtr, MTT_ActiveTrack::Data *&aTempData, MTT_ActiveTrack *&aLocalTrackPtr)
Definition MTT.cpp:118
WsfMTT_Interface * GetInterface() const
Definition MTT.hpp:60
void mttuhi(double aDt, const UtMatrixd &aHorizontalAcceleration, UtMatrixd &aHorizontalInfoMatrix, UtMatrixd &aHorizontalState, const UtMatrixd &aConnectionMatrix, const UtMatrixd &aConnectionMatrixTranspose, const UtMatrixd &aDxDyCovariance, double aSensorLocationX, double aSensorLocationY, double aDx, double aDy, int aTrackType)
Multiple target tracking - update information filter.
Definition MTT.cpp:5622
Definition WsfMTT_Interface.hpp:55
Definition WsfPerfectCorrelation.hpp:22
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Definition WsfTrackId.hpp:33
Definition WsfTrackManager.hpp:62
Copyrights Multiple, All Rights Reserved