WSF
WsfPhysicalScanSensorScheduler Class Reference

#include <WsfPhysicalScanSensorScheduler.hpp>

Inheritance diagram for WsfPhysicalScanSensorScheduler:
Collaboration diagram for WsfPhysicalScanSensorScheduler:

Classes

struct  SensorTarget
struct  SearchModeData

Public Member Functions

 WsfPhysicalScanSensorScheduler ()=default
 WsfPhysicalScanSensorScheduler (std::string aTypeName, bool aRandomizeInitialHeading, SearchListSortFn aSearchListSort)
 ~WsfPhysicalScanSensorScheduler () override=default
WsfSensorSchedulerClone () const override
bool ProcessInput (UtInput &aInput) override
bool Initialize (double aSimTime, WsfSensor *aSensorPtr, WsfSensorTracker *aTrackerPtr) override
void ModeDeselected (double aSimTime, WsfStringId aModeNameId) override
void ModeSelected (double aSimTime, WsfStringId aModeNameId) override
void PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr) override
void RemoveTarget (double aSimTime, size_t aTargetIndex) override
bool SelectTarget (double aSimTime, double &aNextSimTime, size_t &aTargetIndex, WsfTrackId &aRequestId, WsfSensor::Settings &aSettings) override
void TurnOff (double aSimTime) override
void TurnOn (double aSimTime) override
double GetInitialHeading () const
Public Member Functions inherited from WsfSensorScheduler
 WsfSensorScheduler ()
virtual ~WsfSensorScheduler ()=default
bool DebugEnabled () const
 Returns 'true' if debugging is enabled for the scheduler.
void SetDebugEnabled (bool aDebug)
virtual void FrameTimeChanged (double aSimTime, WsfStringId aModeNameId)
virtual int GetActiveRequestCount (WsfStringId aModeNameId) const
virtual int GetMaximumRequestCount (WsfStringId aModeNameId) const
virtual bool HaveRequestFor (const WsfTrackId &aRequestId) const
virtual void PlatformDeleted (WsfPlatform *aPlatformPtr)
virtual const WsfTrackGetTrackForRequest (const WsfTrackId &aRequestId) const
virtual bool StartTracking (double aSimTime, const WsfTrack &aTrack, WsfStringId aModeNameId)
virtual bool StopTracking (double aSimTime, const WsfTrackId &aTrackId)
virtual void TrackerModeChange (double aSimTime, const WsfTrackId &aRequestId, size_t aTargetIndex, WsfPlatform *aTargetPtr, const WsfTrack *aTrackPtr, WsfStringId aModeNameId)
WsfSimulationGetSimulation () const

Static Public Member Functions

static std::unique_ptr< WsfSensorSchedulerObjectFactory (const std::string &aTypeName)

Protected Member Functions

 WsfPhysicalScanSensorScheduler (const WsfPhysicalScanSensorScheduler &aSrc)
WsfPhysicalScanSensorScheduleroperator= (const WsfPhysicalScanSensorScheduler &)=delete
void CheckSearchModeAvailability ()
 Check if the current mode selections provide for the ability to process search chances.
void ResetSearchList ()
Protected Member Functions inherited from WsfSensorScheduler
 WsfSensorScheduler (const WsfSensorScheduler &aSrc)
WsfSensorScheduleroperator= (const WsfSensorScheduler &aSrc)=delete
const SearchListGetSearchList () const

Protected Attributes

std::vector< WsfSensorMode * > mModeList
 The pointers to the sensor modes, indexed by mode index.
size_t mLastExplicitModeIndex {0}
 The last mode explicitly selected (i.e.: via WsfSensor::SelectMode).
std::vector< size_t > mSearchModeIndex {0}
bool mSearchAllowed {false}
 'true' if search chances can be processed.
std::queue< SensorTargetmSensorTargetQueue
 A queue of platform indices representing targets in the sensor's current FOV angle.
double mSensorUpdateInterval {0.0}
 The value of UpdateInterval defined by user at run-time in the input files.
std::map< size_t, SearchModeDatamSearchModeDataMap
double mLastUpdate {-1.0}
Protected Attributes inherited from WsfSensorScheduler
WsfSensormSensorPtr
WsfSensorTrackermTrackerPtr
SearchList mSearchList

Additional Inherited Members

Protected Types inherited from WsfSensorScheduler
using SearchList = std::vector<size_t>
using SearchListIndex = SearchList::size_type

Constructor & Destructor Documentation

◆ WsfPhysicalScanSensorScheduler() [1/3]

WsfPhysicalScanSensorScheduler::WsfPhysicalScanSensorScheduler ( )
default

◆ WsfPhysicalScanSensorScheduler() [2/3]

WsfPhysicalScanSensorScheduler::WsfPhysicalScanSensorScheduler ( std::string aTypeName,
bool aRandomizeInitialHeading,
SearchListSortFn aSearchListSort )

◆ ~WsfPhysicalScanSensorScheduler()

WsfPhysicalScanSensorScheduler::~WsfPhysicalScanSensorScheduler ( )
overridedefault

◆ WsfPhysicalScanSensorScheduler() [3/3]

WsfPhysicalScanSensorScheduler::WsfPhysicalScanSensorScheduler ( const WsfPhysicalScanSensorScheduler & aSrc)
protected

Member Function Documentation

◆ CheckSearchModeAvailability()

void WsfPhysicalScanSensorScheduler::CheckSearchModeAvailability ( )
protected

Check if the current mode selections provide for the ability to process search chances.

References WsfSensorMode::CanSearchWhileTrack(), WsfSensorMode::DisablesSearch(), WsfMode::IsSelected(), mModeList, mSearchAllowed, and mSearchModeIndex.

Referenced by ModeDeselected(), ModeSelected(), operator=(), and TurnOn().

◆ Clone()

WsfSensorScheduler * WsfPhysicalScanSensorScheduler::Clone ( ) const
overridevirtual

◆ GetInitialHeading()

double WsfPhysicalScanSensorScheduler::GetInitialHeading ( ) const
inline

Returns the initial heading (in radians) of the sensor, either as specified via ProcessInput, or otherwise a random value chosen during Initialize. Do not call this before the scheduler is initialized!

◆ Initialize()

bool WsfPhysicalScanSensorScheduler::Initialize ( double aSimTime,
WsfSensor * aSensorPtr,
WsfSensorTracker * aTrackerPtr )
overridevirtual

Initialize the scheduler.

Parameters
aSimTimeThe current simulation time.
aSensorPtrThe sensor with which the scheduler is associated.
aTrackerPtrThe tracker that is associated with the sensor. This can be zero if there is no tracker.
Returns
'true' if successful or 'false' if not.

Reimplemented from WsfSensorScheduler.

References WsfSensorScheduler::DebugEnabled(), WsfModeList::GetDerivedModeList(), WsfSensorMode::GetFrameTime(), WsfSensor::GetModeList(), WsfNamed::GetName(), WsfSimulation::GetRandom(), WsfSensorScheduler::GetSimulation(), WsfSensor::GetUpdateInterval(), WsfSensorScheduler::Initialize(), mLastExplicitModeIndex, mModeList, mSearchModeDataMap, WsfSensorScheduler::mSensorPtr, mSensorUpdateInterval, and ok.

Referenced by ~WsfPhysicalScanSensorScheduler().

◆ ModeDeselected()

void WsfPhysicalScanSensorScheduler::ModeDeselected ( double aSimTime,
WsfStringId aModeNameId )
overridevirtual

A mode has been explicitly deselected. This is called from WsfSensor::DeselectMode to indicate that a mode has been deselected.

Parameters
aSimTimeThe current simulation time.
aModeNameIdThe name (string ID) of the mode that has been deselected.
Note
This is not called for implicit mode deselections that occur with tracking requests.

Reimplemented from WsfSensorScheduler.

References CheckSearchModeAvailability(), mLastExplicitModeIndex, mModeList, and WsfSensorScheduler::mSensorPtr.

Referenced by ~WsfPhysicalScanSensorScheduler().

◆ ModeSelected()

void WsfPhysicalScanSensorScheduler::ModeSelected ( double aSimTime,
WsfStringId aModeNameId )
overridevirtual

A mode has been explicitly selected. This is called from WsfSensor::SelectMode to indicate that a mode has been selected.

Parameters
aSimTimeThe current simulation time.
aModeNameIdThe name (string ID) of the mode that has been selected.
Note
This is not called for implicit mode selections that occur with tracking requests.

Reimplemented from WsfSensorScheduler.

References CheckSearchModeAvailability(), mLastExplicitModeIndex, and WsfSensorScheduler::mSensorPtr.

Referenced by ~WsfPhysicalScanSensorScheduler().

◆ ObjectFactory()

std::unique_ptr< WsfSensorScheduler > WsfPhysicalScanSensorScheduler::ObjectFactory ( const std::string & aTypeName)
static

Factory method for WsfSensorSchedulerTypes to determine if a scheduler represented by this class is being requested.

Referenced by WsfSensorTypes::WsfSensorTypes(), and ~WsfPhysicalScanSensorScheduler().

◆ operator=()

WsfPhysicalScanSensorScheduler & WsfPhysicalScanSensorScheduler::operator= ( const WsfPhysicalScanSensorScheduler & )
protecteddelete

◆ PlatformAdded()

void WsfPhysicalScanSensorScheduler::PlatformAdded ( double aSimTime,
WsfPlatform * aPlatformPtr )
overridevirtual

A platform has been added to the simulation.

Parameters
aSimTimeThe current simulation time.
aPlatformPtrA pointer to the platform that was added.

Reimplemented from WsfSensorScheduler.

References WsfPlatform::GetIndex(), and WsfSensorScheduler::mSearchList.

Referenced by ~WsfPhysicalScanSensorScheduler().

◆ ProcessInput()

bool WsfPhysicalScanSensorScheduler::ProcessInput ( UtInput & aInput)
overridevirtual

◆ RemoveTarget()

void WsfPhysicalScanSensorScheduler::RemoveTarget ( double aSimTime,
size_t aTargetIndex )
overridevirtual

Indicate that the specified target should be removed from further consideration. This is called from the scheduler to indicate that the target should be removed from any scheduling list.

Parameters
aSimTimeThe current simulation time.
aTargetIndexThe object ID of the target to be removed.

Reimplemented from WsfSensorScheduler.

References WsfSensorScheduler::mSearchList.

Referenced by ~WsfPhysicalScanSensorScheduler().

◆ ResetSearchList()

void WsfPhysicalScanSensorScheduler::ResetSearchList ( )
protected

◆ SelectTarget()

bool WsfPhysicalScanSensorScheduler::SelectTarget ( double aSimTime,
double & aNextSimTime,
size_t & aTargetIndex,
WsfTrackId & aRequestId,
WsfSensor::Settings & aSettings )
overridevirtual

Select a target for a detection attempt.

Parameters
aSimTime[input] The current simulation time.
aNextSimTime[output] The simulation time when the scheduler should next be called.
aTargetIndex[output] The object ID of the target to be detected (typically a platform index or some other unique ID). This will not be valid if the return value from the method is false.
aRequestId[output] The request ID (original track ID from StartTracking) associated with the target. aRequest.IsNull() will be true if the target is not associated with a track request. This will not be valid if the return value from the method is false.
aSettings[updated] The sensor settings to be used for the detection attempt. This will not be valid if the return value from the method is false.
Returns
true if a target was selected or false if no target selected.

Reimplemented from WsfSensorScheduler.

References WsfSensorScheduler::DebugEnabled(), WsfObject::GetName(), WsfSimulation::GetPlatformByIndex(), WsfSensorScheduler::GetSimulation(), mLastUpdate, WsfSensor::Settings::mModeIndex, mModeList, mSearchAllowed, WsfSensorScheduler::mSearchList, mSearchModeDataMap, mSearchModeIndex, WsfSensorScheduler::mSensorPtr, mSensorTargetQueue, mSensorUpdateInterval, WsfTrackId::Null(), and WsfPlatform::Update().

Referenced by ~WsfPhysicalScanSensorScheduler().

◆ TurnOff()

void WsfPhysicalScanSensorScheduler::TurnOff ( double aSimTime)
overridevirtual

The sensor is being turned off.

Parameters
aSimTimeThe current simulation time.

Reimplemented from WsfSensorScheduler.

References WsfSensorScheduler::DebugEnabled(), WsfSensorScheduler::mSensorPtr, and ResetSearchList().

Referenced by ~WsfPhysicalScanSensorScheduler().

◆ TurnOn()

void WsfPhysicalScanSensorScheduler::TurnOn ( double aSimTime)
overridevirtual

Member Data Documentation

◆ mLastExplicitModeIndex

size_t WsfPhysicalScanSensorScheduler::mLastExplicitModeIndex {0}
protected

The last mode explicitly selected (i.e.: via WsfSensor::SelectMode).

Referenced by Initialize(), ModeDeselected(), and ModeSelected().

◆ mLastUpdate

double WsfPhysicalScanSensorScheduler::mLastUpdate {-1.0}
protected

The value of Sim Time during the last Update interval. This is used by SelectTarget to know when to search through the list of platforms and create a list of targets to return.

Referenced by SelectTarget().

◆ mModeList

std::vector<WsfSensorMode*> WsfPhysicalScanSensorScheduler::mModeList
protected

The pointers to the sensor modes, indexed by mode index.

Referenced by CheckSearchModeAvailability(), Initialize(), ModeDeselected(), and SelectTarget().

◆ mSearchAllowed

bool WsfPhysicalScanSensorScheduler::mSearchAllowed {false}
protected

'true' if search chances can be processed.

Referenced by CheckSearchModeAvailability(), and SelectTarget().

◆ mSearchModeDataMap

std::map<size_t, SearchModeData> WsfPhysicalScanSensorScheduler::mSearchModeDataMap
protected

Referenced by Initialize(), and SelectTarget().

◆ mSearchModeIndex

std::vector<size_t> WsfPhysicalScanSensorScheduler::mSearchModeIndex {0}
protected

The mode index to be used for searching. If greater than the mode count then searching is disabled.

Referenced by CheckSearchModeAvailability(), and SelectTarget().

◆ mSensorTargetQueue

std::queue<SensorTarget> WsfPhysicalScanSensorScheduler::mSensorTargetQueue
protected

A queue of platform indices representing targets in the sensor's current FOV angle.

Referenced by SelectTarget().

◆ mSensorUpdateInterval

double WsfPhysicalScanSensorScheduler::mSensorUpdateInterval {0.0}
protected

The value of UpdateInterval defined by user at run-time in the input files.

Referenced by Initialize(), and SelectTarget().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved