WSF
WsfDefaultSensorTracker.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 WSFDEFAULTSENSORTRACKER_HPP
13#define WSFDEFAULTSENSORTRACKER_HPP
14
15#include "wsf_export.h"
16
17#include <map>
18
19class WsfFilter;
20#include "WsfSensor.hpp"
21#include "WsfSensorTracker.hpp"
22#include "WsfTrackId.hpp"
23#include "WsfUtil.hpp"
24
30
32{
33public:
35
36 ~WsfDefaultSensorTracker() override;
37
38 WsfSensorTracker* Clone() const override;
39
40 unsigned int GetActiveTrackCount() const override;
41
42 void GetActiveTrackList(WsfTrackList& aActiveTrackList) override;
43
44 unsigned int GetMaximumTrackCount() const override;
45
46 bool GetTargetState(double aSimTime, const WsfTrackId& aRequestId, TargetState& aTargetState) override;
47
48 void GetRequestDataForTarget(size_t aObjectId, WsfTrackId& aRequestId, size_t& aModeIndex, WsfTrackId& aTrackId) const override;
49
50 bool Initialize(double aSimTime, WsfSensor* aSensorPtr, WsfSensorScheduler* aSchedulerPtr) override;
51
52 bool ProcessInput(UtInput& aInput) override;
53
54 void SchedulerModeChange(double aSimTime,
55 const WsfTrackId& aRequestId,
56 size_t aObjectId,
57 WsfPlatform* aTargetPtr,
58 WsfStringId aNewModeName) override;
59
60 void StopTracking(double aSimTime, const WsfTrackId& aRequestId) override;
61
62 virtual void TargetBlocked(double aSimTime, const Settings& aSettings, const WsfTrackId& aRequestId, unsigned int aObjectId);
63
64 bool TargetDeleted(double aSimTime, const Settings& aSettings, const WsfTrackId& aRequestId, size_t aObjectId) override;
65
66 void TargetDetected(double aSimTime,
67 const Settings& aSettings,
68 const WsfTrackId& aRequestId,
69 size_t aObjectId,
70 WsfPlatform* aTargetPtr,
71 WsfSensorResult& aResult) override;
72
73 bool TargetSkipped(double aSimTime, const Settings& aSettings, const WsfTrackId& aRequestId, size_t aObjectId) override;
74
75 void TargetUndetected(double aSimTime,
76 const Settings& aSettings,
77 const WsfTrackId& aRequestId,
78 size_t aObjectId,
79 WsfPlatform* aTargetPtr,
80 WsfSensorResult& aResult) override;
81
82 void TurnOff(double aSimTime) override;
83
85
88 {
89 public:
90 State(const WsfTrackId& aRequestId, const WsfSensor::Result& aResult);
91 ~State();
92
95
98
101
105 double mLockonTime{-1.0};
106
107 static constexpr size_t cINVALID_TARGET_INDEX = ut::npos;
108
111
113 size_t mModeIndex{0};
114
116 size_t mXmtrIndex{0};
117
119 size_t mRcvrIndex{0};
120
125 unsigned int mDetectionHistory{0};
126
130
132 bool mModeSwitchActive{false};
133
135 bool mFalseTargetTrack{false};
136 };
137
138protected:
141
142 void CheckForAutoModeSwitch(double aSimTime, size_t aObjectId, WsfPlatform* aTargetPtr, size_t aNewModeIndex);
143
144 virtual void DropTrack(double aSimTime, State* aStatePtr);
145
146 bool SwitchMode(double aSimTime, State* aStatePtr, size_t aNewModeIndex);
147
148 void ProcessSensorDetectionChanged(double aSimTime, const State& aState, unsigned int aStatus);
149
151
153 unsigned int mMaximumTrackCount;
154
156 unsigned int mActiveTrackCount;
157
161
163 std::vector<WsfSensorMode*> mModeList;
164
168 using StateList = std::map<size_t, State*>;
170
172 using StateListIter = StateList::iterator;
173
176
179};
180
181#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
WsfTrackListT< WsfTrack > WsfTrackList
Definition WsfTrackList.hpp:88
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Used to store state data about the interaction between a sensor and a target.
Definition WsfDefaultSensorTracker.hpp:88
size_t mXmtrIndex
The transmitter number (if any).
Definition WsfDefaultSensorTracker.hpp:116
WsfFilter * mFilterPtr
If non-zero, a pointer to the filter.
Definition WsfDefaultSensorTracker.hpp:97
WsfTrack * mTrackPtr
If non-zero, a pointer to the track.
Definition WsfDefaultSensorTracker.hpp:100
unsigned int mDetectionHistory
Definition WsfDefaultSensorTracker.hpp:125
bool mModeSwitchActive
True if a mode switch is in progress.
Definition WsfDefaultSensorTracker.hpp:132
State(const WsfTrackId &aRequestId, const WsfSensor::Result &aResult)
Definition WsfDefaultSensorTracker.cpp:978
size_t mTargetIndex
The target platform index.
Definition WsfDefaultSensorTracker.hpp:110
size_t mRcvrIndex
The receiver number.
Definition WsfDefaultSensorTracker.hpp:119
int mFailuresUntilDrop
Definition WsfDefaultSensorTracker.hpp:129
WsfTrackId mRequestId
The sensor scheduler request ID associated with the interaction.
Definition WsfDefaultSensorTracker.hpp:94
bool mFalseTargetTrack
True if state id for a false-target track.
Definition WsfDefaultSensorTracker.hpp:135
size_t mModeIndex
The mode index.
Definition WsfDefaultSensorTracker.hpp:113
static constexpr size_t cINVALID_TARGET_INDEX
Definition WsfDefaultSensorTracker.hpp:107
double mLockonTime
Definition WsfDefaultSensorTracker.hpp:105
Definition WsfDefaultSensorTracker.hpp:32
WsfFilter * mFilterPtr
Definition WsfDefaultSensorTracker.hpp:160
StateList mStateList
Definition WsfDefaultSensorTracker.hpp:169
WsfDefaultSensorTracker(WsfScenario &aScenario)
Definition WsfDefaultSensorTracker.cpp:45
void CheckForAutoModeSwitch(double aSimTime, size_t aObjectId, WsfPlatform *aTargetPtr, size_t aNewModeIndex)
Definition WsfDefaultSensorTracker.cpp:878
bool SwitchMode(double aSimTime, State *aStatePtr, size_t aNewModeIndex)
Definition WsfDefaultSensorTracker.cpp:907
std::map< size_t, State * > StateList
Definition WsfDefaultSensorTracker.hpp:168
virtual void DropTrack(double aSimTime, State *aStatePtr)
Definition WsfDefaultSensorTracker.cpp:849
WsfScenario * mScenarioPtr
Definition WsfDefaultSensorTracker.hpp:150
bool mSendTrackDropOnTurnOff
'true' if 'Track Drop' messages should be sent when the sensor is turned off.
Definition WsfDefaultSensorTracker.hpp:175
StateList::iterator StateListIter
An iterator for accessing state data.
Definition WsfDefaultSensorTracker.hpp:172
bool mTurnOffInProgress
'true' if the sensor is being turned off.
Definition WsfDefaultSensorTracker.hpp:178
void ProcessSensorDetectionChanged(double aSimTime, const State &aState, unsigned int aStatus)
Definition WsfDefaultSensorTracker.cpp:947
WsfScenario * GetScenario() const
Definition WsfDefaultSensorTracker.hpp:84
unsigned int mActiveTrackCount
The current number of tracks that are being maintained by the tracker.
Definition WsfDefaultSensorTracker.hpp:156
std::vector< WsfSensorMode * > mModeList
The pointers to the sensor modes, indexed by mode index.
Definition WsfDefaultSensorTracker.hpp:163
unsigned int mMaximumTrackCount
The maximum number of tracks that can be maintained by the tracker.
Definition WsfDefaultSensorTracker.hpp:153
WsfDefaultSensorTracker & operator=(const WsfDefaultSensorTracker &)=delete
Implement a filter as an adapter.
Definition WsfFilter.hpp:24
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 WsfSensorResult.hpp:27
Definition WsfSensorScheduler.hpp:29
A nested class that defines the data returned by GetTargetState.
Definition WsfSensorTracker.hpp:79
virtual void GetActiveTrackList(WsfTrackList &aActiveTrackList)
Return the active tracks the sensor is maintaining.
Definition WsfSensorTracker.cpp:61
virtual unsigned int GetActiveTrackCount() const
Return the number of tracks being maintained by the sensor.
Definition WsfSensorTracker.cpp:53
virtual WsfSensorTracker * Clone() const
Clone this tracker.
Definition WsfSensorTracker.cpp:45
virtual bool ProcessInput(UtInput &aInput)
Definition WsfSensorTracker.cpp:123
virtual bool TargetDeleted(double aSimTime, const Settings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId)
Definition WsfSensorTracker.cpp:195
virtual void TargetBlocked(double aSimTime, const Settings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId)
Definition WsfSensorTracker.cpp:177
virtual void StopTracking(double aSimTime, const WsfTrackId &aRequestId)
Definition WsfSensorTracker.cpp:161
virtual void TargetUndetected(double aSimTime, const Settings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId, WsfPlatform *aTargetPtr, WsfSensorResult &aResult)
Definition WsfSensorTracker.cpp:264
virtual bool Initialize(double aSimTime, WsfSensor *aSensorPtr, WsfSensorScheduler *aSchedulerPtr)
Definition WsfSensorTracker.cpp:111
virtual void SchedulerModeChange(double aSimTime, const WsfTrackId &aRequestId, size_t aObjectId, WsfPlatform *aTargetPtr, WsfStringId aNewModeName)
Definition WsfSensorTracker.cpp:148
virtual void TargetDetected(double aSimTime, const Settings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId, WsfPlatform *aTargetPtr, WsfSensorResult &aResult)
Definition WsfSensorTracker.cpp:217
WsfSensorTracker()
Definition WsfSensorTracker.cpp:25
virtual bool TargetSkipped(double aSimTime, const Settings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId)
Definition WsfSensorTracker.cpp:243
virtual bool GetTargetState(double aSimTime, const WsfTrackId &aRequestId, TargetState &aTargetState)
Definition WsfSensorTracker.cpp:79
WsfSensorTrackerSettings Settings
Definition WsfSensorTracker.hpp:89
virtual void GetRequestDataForTarget(size_t aObjectId, WsfTrackId &aRequestId, size_t &aModeIndex, WsfTrackId &aTrackId) const
Definition WsfSensorTracker.cpp:92
virtual void TurnOff(double aSimTime)
Definition WsfSensorTracker.cpp:277
virtual unsigned int GetMaximumTrackCount() const
Return the maximum number of tracks that can be maintained by the sensor.
Definition WsfSensorTracker.cpp:66
Definition WsfSensor.hpp:92
WsfSensorResult Result
Definition WsfSensor.hpp:96
Definition WsfTrackId.hpp:33
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Copyrights Multiple, All Rights Reserved