WSF
WsfFalseTargetScreener.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
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 WSFFALSETARGETSCREENER_HPP
13#define WSFFALSETARGETSCREENER_HPP
14
15#include "wsf_mil_export.h"
16
17#include <map>
18#include <vector>
19
20#include "UtCloneablePtr.hpp"
21class UtInput;
22class UtInputBlock;
23#include "UtRandom.hpp"
24
25class WsfEM_Xmtr;
28#include "WsfFalseTarget.hpp"
29#include "WsfObject.hpp"
30#include "WsfPlatform.hpp"
31#include "WsfSensor.hpp"
32class WsfSensorMode;
33class WsfTrack;
34#include "WsfTrackId.hpp"
35
40class WSF_MIL_EXPORT WsfFalseTargetScreener : public WsfObject
41{
42public:
43 using FT_JammerPair = std::pair<WsfFalseTarget*, WsfEM_Xmtr*>;
44 using FT_JammerIdPair = std::pair<WsfStringId, unsigned int>;
45 using FT_JammerVec = std::vector<FT_JammerPair>;
46 using FT_Result = std::map<unsigned int, WsfEM_Interaction*>;
47 using BlipAlloc = std::map<WsfFalseTarget::BlipBehavior, int>;
48 using BlipIdFTJammerList = std::vector<std::pair<size_t, FT_JammerPair>>;
49 using TargetIds = std::vector<size_t>;
50 using RR_Map = std::map<WsfFalseTarget::BlipBehavior, double>; // rejection ratio
51 using RR_MapPair = std::pair<WsfFalseTarget::BlipBehavior, double>;
52 using TrackIdMap = std::map<size_t, WsfTrackId>;
53
54 struct ForceData
55 {
56 ForceData(double aAzimuth, double aRange, double aSNR)
57 : mAzimuth(aAzimuth)
58 , mRange(aRange)
59 , mSNR(aSNR)
60 {
61 }
62
63 double mAzimuth;
64 double mRange;
65 double mSNR;
66 };
67 using BlipIdToForceDataMap = std::map<size_t, ForceData>;
68
76
85
89 {
90 cFORCE_NEITHER = 0, //<! The part cannot be slewed
91 cFORCE_INSIDE = 1, //<! The part can be slewed only in azimuth
92 cFORCE_OUTSIDE = 2, //<! The part can be slewed only in elevation
93 cFORCE_IN_OUT = 3 //<! The part can be slewed in both azimuth and elevation
94 };
95
96 static WsfFalseTargetScreener* Find(const WsfSensorMode& aSensorMode);
97
98 explicit WsfFalseTargetScreener(const WsfScenario& aScenario);
101 ~WsfFalseTargetScreener() override;
102 WsfFalseTargetScreener* Clone() const override;
103
104 virtual bool Initialize(double aSimTime, WsfSensorMode* aSensorModePtr, bool aReportsSignalToNoise);
105 bool ProcessInput(UtInput& aInput) override;
106 void ProcessInputBlock(UtInputBlock& aInputBlock);
107
108 bool NeedsUpdated(double aSimTime);
109 void Update(double aSimTime, WsfSensor::Settings& aSettings);
110 void Reset();
111 void PrintScreenerState(double aSimTime);
112
113 void SetSensorModePtr(WsfSensorMode* aSensorModePtr) { mSensorModePtr = aSensorModePtr; }
114 WsfSensorMode* GetSensorModePtr() { return mSensorModePtr; }
115
116 bool ReportsSNR() const { return mReportsSignalToNoise; }
117
118 OutputType GetScreenerOutputType() const { return mOutputType; }
119
121
122 bool GetDebugEnabled() const { return mDebugEnabled; }
123 bool GetScreenerValid() { return mScreenerValid; }
125
127
128 int GetPlotCapacity() const { return mPlotCapacity; }
129 int GetTrackCapacity() const { return mTrackCapacity; }
130 int GetTransferCapacity() const { return mTransferCapacity; }
131 int GetRangeForceType() const { return mRangeForceType; }
132 double GetForceSectorArc() const { return mForceSectorArc; }
133 double GetForceRange() const { return mForceRange; }
134 int GetForceCountPerRangeSector() const { return mForceCountPerRangeSector; }
135 double GetForceJtoSDeltaThreshold() const { return mForceJtoSDeltaThreshold; }
137
139
140 bool FindTrackableBlip(size_t aBlipId);
142 WsfFalseTarget::Blip* GetTrackableBlip(size_t aBlipId);
143
144 bool FindBlockedBlip(size_t aBlipId);
146 WsfFalseTarget::Blip* GetBlockedBlip(size_t aBlipId);
147
148 bool FindUndetectedBlip(size_t aBlipId);
150 WsfFalseTarget::Blip* GetUndetectedBlip(size_t aBlipId);
152
153 WsfFalseTarget* GetFalseTarget(const std::string& aName, WsfEM_Xmtr* aJammerXmtrPtr) const;
154
155 bool AddFalseTarget(FT_JammerPair aFT_JammerPair);
156 bool RemoveFalseTarget(FT_JammerPair aFT_JammerPair);
157 bool RemoveFalseTargets(WsfFalseTarget* aFalseTargetPtr);
158 bool FindFalseTarget(FT_JammerPair aFT_JammerPair);
159
160 WsfEM_Xmtr* GetJammerXmtr(WsfFalseTarget* aFalseTargetPtr) const;
161 bool RemoveJammerXmtr(WsfEM_Xmtr* aJammerXmtrPtr);
162
163 TrackIdMap GetActiveTargetTracks() const;
165
167
168 // TODO - see about refactoring some of these into WsfDefaultSensorTracker
169 void AddFalseTargetTrack(size_t aBlipId, WsfTrackId aTrackId);
170 void DropFalseTargetTrack(size_t aBlipId);
171 bool FindFalseTargetTrack(size_t aBlipId);
172 TrackIdMap GetFalseTargetTracks() { return mFalseTargetTrackIds; };
173
174 bool IsRequestBasedTracking() const { return mRequestBasedTracking; }
175 bool OnlyScreenFT_TrackRequests() const { return mOnlyScreenFT_Requests; }
176
177 inline void AddTargetTrack(WsfStringInt aObjectId, WsfTrack* aValidTrackPtr)
178 {
179 return UpdateTargetTrack(aObjectId, aValidTrackPtr);
180 }
181
182 void UpdateTargetTrack(size_t aObjectId, WsfTrack* aValidTrackPtr);
183 void DropTargetTrack(size_t aObjectId);
184 bool AllowTargetTrack(double aSimTime, size_t aObjectId, WsfTrack* aTrackPtr, const WsfSensorResult& aResult);
185 bool AllowTrackReporting(size_t aObjectId, const WsfTrack* aTrackPtr);
186 void TracksTransfered();
187 bool TrackExists(size_t aObjectId);
189
190 bool IsRadarModeTurnedOn();
191
193
194
195 int GetPassedFalseTargetNumber() const { return mPassedFalseTargetNumber; }
196 int GetPassedRealTargetNumber() const { return mPassedRealTargetNumber; }
197 int GetFalseTargetNumber() const { return (int)mTrackableBlipIds.size(); }
198 int GetRealTargetNumber() const { return (int)(mActiveTargetTrackIds.size() + mForcedTargetTrackIds.size()); }
200
201 WsfPlatform* GetTempPlatform() { return mTempPlatformPtr.get(); }
202 WsfSimulation* GetSimulation() const;
203
204protected:
207
210
213
214
216
220
224
227
231
234
237
238
240
243
246
250
251 int GetAllowedRealTargetNumber() const { return mAllowedRealTargetNumber; }
252
253 void CheckFT_Toggle();
254
255 void RemoveBlips(WsfFalseTarget* aFalseTargetPtr, WsfEM_Xmtr* aJammerXmtrPtr);
256
257 void AdjustTargetsAndBlips(double aSimTime);
258 bool ForceTargetTrack(double aRadar2TargetRange, double aRadar2TargetAzimuth, double aTargetSNR);
259
260private:
261 void SetScreenerValid(bool aBoolValue) { mScreenerValid = aBoolValue; }
262
263 bool CreateBlips(WsfFalseTarget* aFalseTargetPtr, WsfEM_Xmtr* aJammerXmtrPtr);
264 void RemoveBlockedBlips(WsfFalseTarget* aFalseTargetPtr, WsfEM_Xmtr* aJammerXmtr);
265 void RemoveUndetectedBlips(WsfFalseTarget* aFalseTargetPtr, WsfEM_Xmtr* aJammerXmtr);
266 void RemoveTrackableBlips(WsfFalseTarget* aFalseTargetPtr, WsfEM_Xmtr* aJammerXmtr);
267 void UpdateBlips(double aSimTime, WsfSensor::Settings& aSettings);
268 void UpdateFalseTargetJammers(double aSimTime);
269
270 size_t PruneTargetTracks(size_t aPruneQuantity);
271
272 size_t AddTrackableBlips(size_t aAddQuantity);
273 size_t PruneTrackableBlips(size_t aPruneQuantity);
274
275 bool RejectBlips(double aSimTime);
276
278 WsfSensorMode* mSensorModePtr;
279
281 bool mReportsSignalToNoise;
282
283 bool mDebugEnabled;
284 bool mScreenerValid;
285
286 ut::Random mRandom;
287
288 BlipAlloc mBlipsAllocation;
289
291 RR_Map mInitialRejectionRatios;
292
294 RR_Map mRejectionRatios;
295
297 OutputType mOutputType;
298
302 bool mTrackReportingWhenFlooded;
303
305 bool mProduceOutputPlot;
306
308 bool mRequestBasedTracking;
309
311 bool mOnlyScreenFT_Requests;
312
313 Picture mPicture;
314
315 //@name Maximum capacity variables.
317
318 int mPlotCapacity;
319
321 int mTrackCapacity;
322
324 int mTransferCapacity;
326
329 bool mFT_JammerStatusChange;
330
332 double mLastBlipUpdate;
333
335
336 int mForceCountPerRangeSector;
337 double mForceJtoSDeltaThreshold;
338 double mForceSectorArc;
339 double mForceRange;
340
341 RangeForceType mRangeForceType;
342
344 // Used to force target detections and tracks if the target range is less than this value.
345 double mMinimumBlipRange;
346
348 // Used to force target detections and tracks if the target range is less than this value.
349 double mMaximumBlipRange;
350
353 BlipIdToForceDataMap mBlipIdToForceDataMap;
355
357 int mPassedFalseTargetNumber;
358
360 int mPassedRealTargetNumber;
361
363 int mAllowedFalseTargetNumber;
364
366 int mAllowedRealTargetNumber;
367
369 TrackIdMap mFalseTargetTrackIds;
370
372 ut::CloneablePtr<WsfPlatform> mTempPlatformPtr;
373};
374
375#endif
aObjectPtr Update(simTime)
Definition WsfEM_Interaction.hpp:68
Definition WsfEM_Xmtr.hpp:55
WsfEW_FalseTargeEffect models and applies false-target effects.
Definition WsfEW_FalseTargetEffect.hpp:30
Definition WsfFalseTargetScreener.hpp:41
int GetRangeForceType() const
Definition WsfFalseTargetScreener.hpp:131
std::vector< size_t > TargetIds
Definition WsfFalseTargetScreener.hpp:49
std::pair< WsfFalseTarget *, WsfEM_Xmtr * > FT_JammerPair
Definition WsfFalseTargetScreener.hpp:43
TrackIdMap mForcedTargetTrackIds
Definition WsfFalseTargetScreener.hpp:223
TrackIdMap mReportingTrackIds
Reportable Track Id list from the sensor tracker. The sensor tracker manages this list.
Definition WsfFalseTargetScreener.hpp:206
void UpdateTargetTrack(size_t aObjectId, WsfTrack *aValidTrackPtr)
Definition WsfFalseTargetScreener.cpp:570
double mLastUpdate
The last time a full update of the screener was achieved.
Definition WsfFalseTargetScreener.hpp:233
int GetRealTargetNumber() const
Definition WsfFalseTargetScreener.hpp:198
OutputType GetScreenerOutputType() const
Definition WsfFalseTargetScreener.hpp:118
bool mBlipsAdjusted
Definition WsfFalseTargetScreener.hpp:247
std::vector< std::pair< size_t, FT_JammerPair > > BlipIdFTJammerList
Definition WsfFalseTargetScreener.hpp:48
std::map< unsigned int, WsfEM_Interaction * > FT_Result
Definition WsfFalseTargetScreener.hpp:46
BlipIdFTJammerList & GetUndetectedBlipIds()
Definition WsfFalseTargetScreener.hpp:149
std::vector< FT_JammerPair > FT_JammerVec
Definition WsfFalseTargetScreener.hpp:45
virtual bool Initialize(double aSimTime, WsfSensorMode *aSensorModePtr, bool aReportsSignalToNoise)
Definition WsfFalseTargetScreener.cpp:202
bool GetDebugEnabled() const
Definition WsfFalseTargetScreener.hpp:122
bool IsRequestBasedTracking() const
Definition WsfFalseTargetScreener.hpp:174
WsfFalseTargetScreener & operator=(const WsfFalseTargetScreener &)=delete
BlipIdFTJammerList & GetTrackableBlipIds()
Definition WsfFalseTargetScreener.hpp:141
void ProcessInputBlock(UtInputBlock &aInputBlock)
A convenience method to check for and process a 'false_target_screener/end_false_target_screener' blo...
Definition WsfFalseTargetScreener.cpp:392
int GetPassedRealTargetNumber() const
Definition WsfFalseTargetScreener.hpp:196
int GetTrackCapacity() const
Definition WsfFalseTargetScreener.hpp:129
std::map< size_t, ForceData > BlipIdToForceDataMap
Definition WsfFalseTargetScreener.hpp:67
int GetAllowedRealTargetNumber() const
Definition WsfFalseTargetScreener.hpp:251
TrackIdMap GetFalseTargetTracks()
Definition WsfFalseTargetScreener.hpp:172
BlipIdFTJammerList mTrackableBlipIds
Track-able blip list (i.e. detected).
Definition WsfFalseTargetScreener.hpp:245
void Reset()
Definition WsfFalseTargetScreener.cpp:1721
double GetForceRange() const
Definition WsfFalseTargetScreener.hpp:133
BlipIdFTJammerList mUndetectedBlipIds
Undetectable blip list.
Definition WsfFalseTargetScreener.hpp:242
bool mTargetsAdjusted
Definition WsfFalseTargetScreener.hpp:228
TrackIdMap mNullTargetTrackIds
List of target track Ids that are being detected but not yet a track in the sensor tracker.
Definition WsfFalseTargetScreener.hpp:226
bool mBlipsInvalid
Definition WsfFalseTargetScreener.hpp:248
BlipIdFTJammerList & GetBlockedBlipIds()
Definition WsfFalseTargetScreener.hpp:145
OutputType
Describe the output state of this object.
Definition WsfFalseTargetScreener.hpp:71
@ cPLOT
Producing plotted output, a pseudo-radar screen representation.
Definition WsfFalseTargetScreener.hpp:72
@ cTRACKS
Producing tracks, for communication to external entities.
Definition WsfFalseTargetScreener.hpp:73
@ cOVERLOAD
Countermeasures have produced an excessive number of false targets, causing an overload.
Definition WsfFalseTargetScreener.hpp:74
bool mTargetsInvalid
Definition WsfFalseTargetScreener.hpp:229
bool OnlyScreenFT_TrackRequests() const
Definition WsfFalseTargetScreener.hpp:175
void SetSensorModePtr(WsfSensorMode *aSensorModePtr)
Definition WsfFalseTargetScreener.hpp:113
std::pair< WsfFalseTarget::BlipBehavior, double > RR_MapPair
Definition WsfFalseTargetScreener.hpp:51
std::map< size_t, WsfTrackId > TrackIdMap
Definition WsfFalseTargetScreener.hpp:52
TrackIdMap mActiveTargetTrackIds
List of active target track Ids that are being tracked in the sensor tracker.
Definition WsfFalseTargetScreener.hpp:215
int GetFalseTargetNumber() const
Definition WsfFalseTargetScreener.hpp:197
int GetTransferCapacity() const
Definition WsfFalseTargetScreener.hpp:130
std::map< WsfFalseTarget::BlipBehavior, double > RR_Map
Definition WsfFalseTargetScreener.hpp:50
void PrintScreenerState(double aSimTime)
Definition WsfFalseTargetScreener.cpp:1139
bool GetScreenerValid()
Definition WsfFalseTargetScreener.hpp:123
std::map< WsfFalseTarget::BlipBehavior, int > BlipAlloc
Definition WsfFalseTargetScreener.hpp:47
double GetForceJtoSDeltaThreshold() const
Definition WsfFalseTargetScreener.hpp:135
Picture
Definition WsfFalseTargetScreener.hpp:80
@ cPERFECT
Enough energy is injected to produce the desired effect.
Definition WsfFalseTargetScreener.hpp:81
@ cINEFFECTIVE
Not successful with the desired effect.
Definition WsfFalseTargetScreener.hpp:83
@ cDEGRADED
Marginally effective.
Definition WsfFalseTargetScreener.hpp:82
FT_JammerVec mFalseTargetsJammers
List of false target jammer pairs being considered by screener function.
Definition WsfFalseTargetScreener.hpp:209
bool NeedsUpdated(double aSimTime)
Definition WsfFalseTargetScreener.cpp:1653
WsfFalseTargetScreener(const WsfScenario &aScenario)
Definition WsfFalseTargetScreener.cpp:77
std::pair< WsfStringId, unsigned int > FT_JammerIdPair
Definition WsfFalseTargetScreener.hpp:44
WsfPlatform * GetTempPlatform()
Definition WsfFalseTargetScreener.hpp:201
double GetForceSectorArc() const
Definition WsfFalseTargetScreener.hpp:132
TrackIdMap GetBlockedTargets()
Definition WsfFalseTargetScreener.hpp:164
WsfSensorMode * GetSensorModePtr()
Definition WsfFalseTargetScreener.hpp:114
int GetForceCountPerRangeSector() const
Definition WsfFalseTargetScreener.hpp:134
RangeForceType
Definition WsfFalseTargetScreener.hpp:89
@ cFORCE_NEITHER
Definition WsfFalseTargetScreener.hpp:90
@ cFORCE_IN_OUT
Definition WsfFalseTargetScreener.hpp:93
@ cFORCE_INSIDE
Definition WsfFalseTargetScreener.hpp:91
@ cFORCE_OUTSIDE
Definition WsfFalseTargetScreener.hpp:92
int GetPlotCapacity() const
Definition WsfFalseTargetScreener.hpp:128
bool ReportsSNR() const
Definition WsfFalseTargetScreener.hpp:116
TrackIdMap mBlockedTargetTrackIds
Definition WsfFalseTargetScreener.hpp:219
BlipIdFTJammerList mBlockedBlipIds
Blocked but detectable blip list.
Definition WsfFalseTargetScreener.hpp:239
void AddTargetTrack(WsfStringInt aObjectId, WsfTrack *aValidTrackPtr)
Definition WsfFalseTargetScreener.hpp:177
int GetPassedFalseTargetNumber() const
Definition WsfFalseTargetScreener.hpp:195
An instance of this class quantitatively models the multiple false targets that will be perceived by.
Definition WsfFalseTarget.hpp:50
WsfFalseTargetBlip Blip
Definition WsfFalseTarget.hpp:58
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
virtual WsfObject * Clone() const =0
virtual bool ProcessInput(UtInput &aInput)
Definition WsfObject.cpp:140
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfSensorMode.hpp:36
Definition WsfSensorResult.hpp:27
Definition WsfSensor.hpp:133
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfStringId.hpp:29
Definition WsfTrackId.hpp:33
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
ForceData(double aAzimuth, double aRange, double aSNR)
Definition WsfFalseTargetScreener.hpp:56
double mSNR
Definition WsfFalseTargetScreener.hpp:65
double mRange
Definition WsfFalseTargetScreener.hpp:64
double mAzimuth
Definition WsfFalseTargetScreener.hpp:63
Copyrights Multiple, All Rights Reserved