WSF
WsfDefaultSensorScheduler Class Reference

#include <WsfDefaultSensorScheduler.hpp>

Inheritance diagram for WsfDefaultSensorScheduler:
Collaboration diagram for WsfDefaultSensorScheduler:

Classes

class  Request
class  CompareRequestId
 A Functor for locating a track request. More...

Public Types

using RequestList = std::vector<Request>
using RequestListIndex = RequestList::size_type

Public Member Functions

 WsfDefaultSensorScheduler ()
 ~WsfDefaultSensorScheduler () override=default
WsfSensorSchedulerClone () const override
void FrameTimeChanged (double aSimTime, WsfStringId aModeNameId) override
int GetActiveRequestCount (WsfStringId aModeNameId) const override
int GetMaximumRequestCount (WsfStringId aModeNameId) const override
bool HaveRequestFor (const WsfTrackId &aRequestId) const 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 PlatformDeleted (WsfPlatform *aPlatformPtr) override
bool ProcessInput (UtInput &aInput) override
void RemoveTarget (double aSimTime, size_t aTargetIndex) override
const WsfTrackGetTrackForRequest (const WsfTrackId &aRequestId) const override
bool SelectTarget (double aSimTime, double &aNextSimTime, size_t &aTargetIndex, WsfTrackId &aRequestId, WsfSensor::Settings &aSettings) override
bool StartTracking (double aSimTime, const WsfTrack &aTrack, WsfStringId aModeNameId) override
bool StopTracking (double aSimTime, const WsfTrackId &aRequestId) override
void TrackerModeChange (double aSimTime, const WsfTrackId &aRequestId, size_t aTargetIndex, WsfPlatform *aTargetPtr, const WsfTrack *aTrackPtr, WsfStringId aModeNameId) override
void TurnOff (double aSimTime) override
void TurnOn (double aSimTime) override
const RequestListGetRequestList () 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)
WsfSimulationGetSimulation () const

Static Public Member Functions

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

Protected Types

enum  ScanSchedulingMethod { cSSM_RANDOM , cSSM_INPUT_ORDER , cSSM_REVERSE_INPUT_ORDER }
Protected Types inherited from WsfSensorScheduler
using SearchList = std::vector<size_t>
using SearchListIndex = SearchList::size_type

Protected Member Functions

 WsfDefaultSensorScheduler (const WsfDefaultSensorScheduler &aSrc)
WsfDefaultSensorScheduleroperator= (const WsfDefaultSensorScheduler &)=delete
void CheckSearchModeAvailability ()
 Check if the current mode selections provide for the ability to process search chances.
void DeselectMode (double aSimTime, Request &aRequest)
 Deselect the mode associated with the current request if it is not in use by other requests.
void SelectMode (double aSimTime, Request &aRequest)
void ResetTrackList ()
void ResetSearchList ()
size_t SelectTargetForRequest (Request &aRequest)
bool TargetHasActiveRequest (size_t aTargetIndex) const
 Returns true if the target has an active request against it.
void UpdateNextTrackVisitTime ()
void UpdateSearchChanceInterval ()
void UpdateSearchFrameTime (double aSimTime)
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.
double mDwellEndTime
double mNextSearchVisitTime
double mNextTrackVisitTime
double mSearchChanceInterval
double mSearchFrameTime
SearchListIndex mSearchIndex
 The vector index of the next search chance to be performed.
RequestList mRequestList
 A list of active track requests.
RequestListIndex mRequestIndex
 The index of the next request to be performed.
size_t mLastExplicitModeIndex
 The last mode explicitly selected (i.e.: via WsfSensor::SelectMode).
size_t mSearchModeIndex
bool mSearchAllowed
 'true' if search chances can be processed.
bool mCheckSearchList
ScanSchedulingMethod mScanSchedulingMethod
 How scan chances are added to the search list.
Protected Attributes inherited from WsfSensorScheduler
WsfSensormSensorPtr
WsfSensorTrackermTrackerPtr
SearchList mSearchList

Detailed Description

The default sensor scheduler given to sensors.

In search mode, this schedules detection chances for a sensor using a statistical scan. Times of detection chances are random and independent of the target's location, but still constrained by the 'frame_time'.

Member Typedef Documentation

◆ RequestList

◆ RequestListIndex

using WsfDefaultSensorScheduler::RequestListIndex = RequestList::size_type

Member Enumeration Documentation

◆ ScanSchedulingMethod

Enumerator
cSSM_RANDOM 
cSSM_INPUT_ORDER 
cSSM_REVERSE_INPUT_ORDER 

Constructor & Destructor Documentation

◆ WsfDefaultSensorScheduler() [1/2]

◆ ~WsfDefaultSensorScheduler()

WsfDefaultSensorScheduler::~WsfDefaultSensorScheduler ( )
overridedefault

◆ WsfDefaultSensorScheduler() [2/2]

Member Function Documentation

◆ CheckSearchModeAvailability()

void WsfDefaultSensorScheduler::CheckSearchModeAvailability ( )
protected

◆ Clone()

WsfSensorScheduler * WsfDefaultSensorScheduler::Clone ( ) const
overridevirtual

◆ DeselectMode()

void WsfDefaultSensorScheduler::DeselectMode ( double aSimTime,
Request & aRequest )
protected

◆ FrameTimeChanged()

void WsfDefaultSensorScheduler::FrameTimeChanged ( double aSimTime,
WsfStringId aModeNameId )
overridevirtual

A notification call to indicate the frame time for the specified mode has changed.

Parameters
aSimTimeThe current simulation time.
aModeNameIdThe name (string ID) of the mode.

Reimplemented from WsfSensorScheduler.

References UpdateSearchFrameTime().

◆ GetActiveRequestCount()

int WsfDefaultSensorScheduler::GetActiveRequestCount ( WsfStringId aModeNameId) const
overridevirtual

Return the number of requests that are active in a specified mode.

Parameters
aModeNameIdThe name (string ID) of the mode.

Reimplemented from WsfSensorScheduler.

References mModeList, mRequestList, and WsfSensorScheduler::mSensorPtr.

◆ GetMaximumRequestCount()

int WsfDefaultSensorScheduler::GetMaximumRequestCount ( WsfStringId aModeNameId) const
overridevirtual

Return the maximum number of requests that can be processed by the indicated mode.

Parameters
aModeNameIdThe name (string ID) of the mode.

Reimplemented from WsfSensorScheduler.

References mModeList, and WsfSensorScheduler::mSensorPtr.

Referenced by StartTracking().

◆ GetRequestList()

const RequestList & WsfDefaultSensorScheduler::GetRequestList ( ) const
inline

◆ GetTrackForRequest()

const WsfTrack & WsfDefaultSensorScheduler::GetTrackForRequest ( const WsfTrackId & aRequestId) const
overridevirtual

Returns the track data for the request, this return is of a constant type to prevent modification.

Parameters
aRequestIdThe track ID. This should be the track ID of a track submitted to StartTracking.
Returns
The track that corresponds to the request.

Reimplemented from WsfSensorScheduler.

References mRequestList.

◆ HaveRequestFor()

bool WsfDefaultSensorScheduler::HaveRequestFor ( const WsfTrackId & aRequestId) const
overridevirtual

Does the scheduler have a request for the indicated track ID?

Parameters
aRequestIdThe track ID. This should be the track ID of a track submitted to StartTracking.

Reimplemented from WsfSensorScheduler.

References mRequestList.

◆ Initialize()

bool WsfDefaultSensorScheduler::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 WsfModeList::GetDerivedModeList(), WsfSensor::GetModeList(), WsfSensorScheduler::Initialize(), mLastExplicitModeIndex, mModeList, WsfSensorScheduler::mSensorPtr, and ok.

◆ ModeDeselected()

void WsfDefaultSensorScheduler::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(), mCheckSearchList, mLastExplicitModeIndex, mModeList, mSearchAllowed, and WsfSensorScheduler::mSensorPtr.

◆ ModeSelected()

void WsfDefaultSensorScheduler::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(), mCheckSearchList, mLastExplicitModeIndex, mModeList, mSearchAllowed, WsfSensorScheduler::mSensorPtr, and UpdateSearchFrameTime().

◆ ObjectFactory()

std::unique_ptr< WsfSensorScheduler > WsfDefaultSensorScheduler::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 ~WsfDefaultSensorScheduler().

◆ operator=()

◆ PlatformAdded()

void WsfDefaultSensorScheduler::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 cSSM_INPUT_ORDER, cSSM_RANDOM, cSSM_REVERSE_INPUT_ORDER, WsfPlatform::GetIndex(), WsfPlatform::GetSimulation(), mScanSchedulingMethod, mSearchIndex, WsfSensorScheduler::mSearchList, and UpdateSearchChanceInterval().

◆ PlatformDeleted()

void WsfDefaultSensorScheduler::PlatformDeleted ( WsfPlatform * aPlatformPtr)
overridevirtual

A platform has been removed from the simulation.

Parameters
aPlatformPtrA pointer to the platform that was deleted.

Reimplemented from WsfSensorScheduler.

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

◆ ProcessInput()

bool WsfDefaultSensorScheduler::ProcessInput ( UtInput & aInput)
overridevirtual

◆ RemoveTarget()

void WsfDefaultSensorScheduler::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 mSearchIndex, WsfSensorScheduler::mSearchList, and UpdateSearchChanceInterval().

◆ ResetSearchList()

◆ ResetTrackList()

void WsfDefaultSensorScheduler::ResetTrackList ( )
protected

References mNextTrackVisitTime, mRequestIndex, and mRequestList.

Referenced by operator=(), and TurnOff().

◆ SelectMode()

void WsfDefaultSensorScheduler::SelectMode ( double aSimTime,
Request & aRequest )
protected

◆ SelectTarget()

bool WsfDefaultSensorScheduler::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 WsfEM_Util::ComputeApparentPosition(), WsfSensorScheduler::DebugEnabled(), WsfSensorMode::GetDwellTime(), WsfMeasurement::GetExtrapolatedLocationWCS(), WsfSimulation::GetPlatformByIndex(), WsfSimulation::GetPlatformNameId(), WsfSensorMode::GetRevisitTime(), mCheckSearchList, mDwellEndTime, WsfSensorTracker::TargetState::mLocationWCS, WsfSensor::Settings::mLockonTime, WsfSensorTracker::TargetState::mLockonTime, WsfDefaultSensorScheduler::Request::mModeIndex, WsfSensor::Settings::mModeIndex, mModeList, mNextSearchVisitTime, mNextTrackVisitTime, WsfDefaultSensorScheduler::Request::mNextVisitTime, WsfDefaultSensorScheduler::Request::mRequestId, mRequestIndex, mRequestList, mSearchAllowed, mSearchChanceInterval, mSearchIndex, WsfSensorScheduler::mSearchList, mSearchModeIndex, WsfSensorScheduler::mSensorPtr, WsfDefaultSensorScheduler::Request::mTrack, WsfSensorScheduler::mTrackerPtr, WsfTrackId::Null(), SelectTargetForRequest(), TargetHasActiveRequest(), targetIndex(), and UpdateNextTrackVisitTime().

◆ SelectTargetForRequest()

size_t WsfDefaultSensorScheduler::SelectTargetForRequest ( Request & aRequest)
protected

◆ StartTracking()

bool WsfDefaultSensorScheduler::StartTracking ( double aSimTime,
const WsfTrack & aTrack,
WsfStringId aModeNameId )
overridevirtual

Start tracking a target specified by a track.

Parameters
aSimTimeThe current simulation time.
aTrackThe target track cue.
aModeNameIdThe mode name (string ID) of the mode to be used. If zero then the implementation will choose an appropriate mode.
Returns
'true' if the tracking request was accepted or 'false' if not.

Reimplemented from WsfSensorScheduler.

References WsfSensorScheduler::DebugEnabled(), DeselectMode(), WsfSensorMode::GetFrameTime(), GetMaximumRequestCount(), WsfTrack::GetTrackId(), WsfTrack::GetUpdateTime(), WsfDefaultSensorScheduler::Request::mModeIndex, mModeList, mNextSearchVisitTime, mNextTrackVisitTime, WsfDefaultSensorScheduler::Request::mNextVisitTime, mRequestList, WsfSensorScheduler::mSensorPtr, WsfDefaultSensorScheduler::Request::mTrack, SelectMode(), WsfObserver::SensorRequestInitiated(), WsfObserver::SensorRequestUpdated(), and UpdateNextTrackVisitTime().

◆ StopTracking()

bool WsfDefaultSensorScheduler::StopTracking ( double aSimTime,
const WsfTrackId & aRequestId )
overridevirtual

Stop tracking a target.

Parameters
aSimTimeThe current simulation time.
aRequestIdThe track ID from the track that was provided to StartTracking.
Returns
'true' if the request was stopped.

Reimplemented from WsfSensorScheduler.

References WsfSensorScheduler::DebugEnabled(), DeselectMode(), mRequestList, WsfSensorScheduler::mSensorPtr, WsfDefaultSensorScheduler::Request::mTrack, WsfSensorScheduler::mTrackerPtr, WsfObserver::SensorRequestCanceled(), and UpdateNextTrackVisitTime().

◆ TargetHasActiveRequest()

bool WsfDefaultSensorScheduler::TargetHasActiveRequest ( size_t aTargetIndex) const
protected

Returns true if the target has an active request against it.

References mRequestList.

Referenced by operator=(), and SelectTarget().

◆ TrackerModeChange()

void WsfDefaultSensorScheduler::TrackerModeChange ( double aSimTime,
const WsfTrackId & aRequestId,
size_t aTargetIndex,
WsfPlatform * aTargetPtr,
const WsfTrack * aTrackPtr,
WsfStringId aModeNameId )
overridevirtual

The tracker has changed the mode for the requested target.

Parameters
aSimTimeThe current simulation time.
aRequestIdIf non-zero, the associated sensor scheduler request ID.
aTargetIndexThe index of the target of interest. For a platform this should be its platform ID and for other objects it should be their unique ID.
aTargetPtrThe pointer of the target of interest.
aTrackPtrPointer to the current track associated with the target (may be zero).
aModeNameIdThe name (ID) of the new mode.

Reimplemented from WsfSensorScheduler.

References WsfSensorScheduler::DebugEnabled(), DeselectMode(), WsfSensorMode::GetFrameTime(), WsfDefaultSensorScheduler::Request::mModeIndex, mModeList, WsfDefaultSensorScheduler::Request::mNextVisitTime, WsfDefaultSensorScheduler::Request::mRequestId, mRequestList, WsfSensorScheduler::mSensorPtr, WsfDefaultSensorScheduler::Request::mTrack, SelectMode(), WsfObserver::SensorRequestUpdated(), and UpdateNextTrackVisitTime().

◆ TurnOff()

void WsfDefaultSensorScheduler::TurnOff ( double aSimTime)
overridevirtual

The sensor is being turned off.

Parameters
aSimTimeThe current simulation time.

Reimplemented from WsfSensorScheduler.

Reimplemented in WsfSensorsManagerFovSensorScheduler.

References ResetSearchList(), and ResetTrackList().

◆ TurnOn()

void WsfDefaultSensorScheduler::TurnOn ( double aSimTime)
overridevirtual

◆ UpdateNextTrackVisitTime()

void WsfDefaultSensorScheduler::UpdateNextTrackVisitTime ( )
protected

Update the time when the next track revisit should occur. Note that the 'next visit time' is the time that would occur if there were no interference. What we look for is the 'oldest' request (the one with the smallest next visit time). The visit time is then adjusted as required.

References mDwellEndTime, mNextTrackVisitTime, mRequestIndex, and mRequestList.

Referenced by operator=(), SelectTarget(), StartTracking(), StopTracking(), TrackerModeChange(), TurnOn(), and WsfSensorsManagerFovSensorScheduler::TurnOn().

◆ UpdateSearchChanceInterval()

void WsfDefaultSensorScheduler::UpdateSearchChanceInterval ( )
protected

Update the interval between scan sensing chances. This should be called whenever the scan sensing chance entry is added or deleted or whenever the search mode is changed.

References mModeList, mSearchAllowed, mSearchChanceInterval, mSearchFrameTime, WsfSensorScheduler::mSearchList, mSearchModeIndex, and WsfSensorScheduler::mSensorPtr.

Referenced by operator=(), PlatformAdded(), RemoveTarget(), TurnOn(), WsfSensorsManagerFovSensorScheduler::TurnOn(), and UpdateSearchFrameTime().

◆ UpdateSearchFrameTime()

Member Data Documentation

◆ mCheckSearchList

bool WsfDefaultSensorScheduler::mCheckSearchList
protected

'true' if SelectTarget should check the search list for tracks or targets that need to be delete. This is done only when a search mode is not active.

Referenced by ModeDeselected(), ModeSelected(), PlatformDeleted(), SelectTarget(), TurnOn(), WsfSensorsManagerFovSensorScheduler::TurnOn(), WsfDefaultSensorScheduler(), and WsfDefaultSensorScheduler().

◆ mDwellEndTime

◆ mLastExplicitModeIndex

size_t WsfDefaultSensorScheduler::mLastExplicitModeIndex
protected

◆ mModeList

◆ mNextSearchVisitTime

◆ mNextTrackVisitTime

◆ mRequestIndex

RequestListIndex WsfDefaultSensorScheduler::mRequestIndex
protected

The index of the next request to be performed.

Referenced by ResetTrackList(), SelectTarget(), UpdateNextTrackVisitTime(), WsfDefaultSensorScheduler(), and WsfDefaultSensorScheduler().

◆ mRequestList

◆ mScanSchedulingMethod

ScanSchedulingMethod WsfDefaultSensorScheduler::mScanSchedulingMethod
protected

How scan chances are added to the search list.

Referenced by PlatformAdded(), ProcessInput(), WsfDefaultSensorScheduler(), and WsfDefaultSensorScheduler().

◆ mSearchAllowed

bool WsfDefaultSensorScheduler::mSearchAllowed
protected

◆ mSearchChanceInterval

double WsfDefaultSensorScheduler::mSearchChanceInterval
protected

◆ mSearchFrameTime

double WsfDefaultSensorScheduler::mSearchFrameTime
protected

◆ mSearchIndex

SearchListIndex WsfDefaultSensorScheduler::mSearchIndex
protected

The vector index of the next search chance to be performed.

Referenced by PlatformAdded(), RemoveTarget(), ResetSearchList(), SelectTarget(), WsfDefaultSensorScheduler(), and WsfDefaultSensorScheduler().

◆ mSearchModeIndex

size_t WsfDefaultSensorScheduler::mSearchModeIndex
protected

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

Referenced by CheckSearchModeAvailability(), SelectTarget(), UpdateSearchChanceInterval(), UpdateSearchFrameTime(), WsfDefaultSensorScheduler(), and WsfDefaultSensorScheduler().


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