WSF
WsfTaskManager Class Reference

#include <WsfTaskManager.hpp>

Inheritance diagram for WsfTaskManager:
Collaboration diagram for WsfTaskManager:

Classes

struct  PendingMessage
struct  ActiveTrack
struct  SensorRequest
class  EventBase
class  TaskCompleteEvent
 A event for scheduling the completion of a task. More...
class  TrackUpdateEvent
 A event for sending track updates to assignees. More...

Public Types

enum  TrackUpdateStrategy { cDEFAULT , cBATCH }
using RoleIterator = WsfComponentList::RoleIterator<WsfTaskManagerComponent>
 typedef to simplify iteration for calling WsfTaskManagerComponent methods.
using TaskList = std::list<WsfTask>
using PendingMessageList = std::list<PendingMessage>
using TrackList = std::list<ActiveTrack>
using TrackListIter = std::list<ActiveTrack>::iterator
using SensorRequestList = std::list<SensorRequest>
using ComponentList = WsfComponentListT<WsfProcessorComponent>
Public Types inherited from WsfPlatformPart
enum  { cLEVEL_ONE_DEBUG = 0x00000001 , cLEVEL_TWO_DEBUG = 0x00000002 }
using InternalMessageQueue = std::queue<WsfMessage*>
using RecipientMessageQueue = std::queue<std::pair<WsfPlatformPart*, WsfMessage*>>
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.

Public Member Functions

 WsfTaskManager (WsfScenario &aScenario, const std::string &aClassName="WsfTaskManager")
 Constructor.
WsfTaskManageroperator= (const WsfTaskManager &)=delete
 ~WsfTaskManager () override=default
const char * GetScriptClassName () const override
Public Member Functions inherited from WsfScriptProcessor
 WsfScriptProcessor (const WsfScenario &aScenario)
 WsfScriptProcessor (const WsfScenario &aScenario, WsfStringId aPartClass, const std::string &aPartVarName)
 ~WsfScriptProcessor () override
void SendMessage (double aSimTime, const WsfMessage &aMessage) override
virtual void ExecuteOnMessageCreate (double aSimTime, WsfMessage &aMessage)
virtual bool ExecuteScript (double aSimTime, const std::string &aScriptName)
virtual bool ExecuteScript (double aSimTime, WsfStringId aScriptName, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs=UtScriptDataList())
void ExecuteScriptAtTime (double aTime, WsfStringId aScriptName, const UtScriptDataList &aScriptArgs)
virtual void SuppressMessage (bool aSuppressMessage)
WsfScriptMessageHandlerGetMessageHandler ()
WsfScriptContextGetScriptContext ()
UtScriptContext * GetScriptAccessibleContext () const override
void SetPlatform (WsfPlatform *aPlatformPtr) override
const WsfBehaviorTreeBehaviorTree () const
WsfAdvancedBehaviorTreeAdvancedBehaviorTree () const
virtual const WsfScriptStateMachineGetStateMachine () const
wsf::ExternalLinksGetExternalLinks ()
std::string State ()
std::string StateAll ()
void SetState (std::string &stateName)
void SetStateAll (std::string &stateNameAll)
Public Member Functions inherited from WsfProcessor
 WsfProcessor (const WsfScenario &aScenario)
 ~WsfProcessor () override=default
ComponentListGetComponents ()
const ComponentListGetComponents () const
virtual void ProcessCallback (double aSimTime, const WsfCallback &aCallback)
WsfComponentCloneComponent () const override
int GetComponentInitializationOrder () const override
const char * GetScriptClassName () const override
void PreInput () override
void SetNonOperational (double aSimTime) override
void SetOperational (double aSimTime) override
void PartBroken (double aSimTime) override
double GetUpdateInterval () const override
void SetUpdateInterval (double aUpdateInterval) override
Public Member Functions inherited from WsfPlatformPart
 WsfPlatformPart (const WsfScenario &aScenario, int aPartType)
WsfPlatformPartoperator= (const WsfPlatformPart &aRhs)=delete
 ~WsfPlatformPart () override
bool DebugEnabled () const
 Returns 'true' if debugging is enabled for this instance.
void SetDebugEnabled (bool aDebugEnabled)
unsigned int GetDebugMask ()
bool IsExternallyControlled () const
virtual void SetExternallyControlled (double aSimTime, bool aIsExternallyControlled)
int GetPartType () const
const char * GetScriptClassName () const override
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
WsfStringId GetComponentName () const override
void ComponentParentChanged (WsfPlatform *aPlatformPtr) override
WsfPlatformGetPlatform () const
virtual void PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr)
double GetLastStatusChangeTime () const
void SetLastStatusChangeTime (double aSimTime)
 Allows a system to set the time at which the device was initialized.
bool CanBeMadeOperational () const
 Returns an indication that this system can be made operational.
bool CanBeMadeNonOperational () const
 Returns an indication that this system can be made non-operational.
bool CanBeTurnedOn () const
 Returns an indication that this system can be turned on.
bool CanBeTurnedOff () const
 Returns an indication that this system can be turned off.
bool IsTurnedOn () const
bool InitiallyTurnedOn () const
 Is the system to be turned 'on' when added to the simulation?
void SetInitiallyTurnedOn (bool aInitiallyTurnedOn)
 Sets if the system is turned on when added to the simulation.
virtual void Restore (double aSimTime)
bool IsOperational () const
bool SetOperational (double aSimTime, bool aMakeOperational)
double GetDamageFactor () const
bool SetDamageFactor (double aSimTime, double aDamageFactor)
bool IsCritical () const
void SetCritical (bool aValue)
virtual void OnPlatformBrokenEvent (double aSimTime)
 Owning platform has issued a broken event.
bool IsBroken () const
WsfInternalLinksGetInternalLinks ()
 Return the internal links for this part.
virtual bool HasInternalLinks () const
 Does this platform part have a communication link to other platform parts?
virtual void SendMessageTo (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId)
void SendMessageToProcessor (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId)
virtual void SendQueuedMessages (double aSimTime)
const WsfCategoryListGetCategories () const
 Get the categories to which this part belongs.
void AddCategory (WsfStringId aCategoryId)
 Adds the provided category to the platform part's category list.
bool IsCategoryMember (WsfStringId aCategoryId) const
const WsfGroupListGetGroups () const
 Get the groups to which this platform part belongs.
void JoinGroup (WsfGroup *aGroupPtr)
 Join the given group.
void LeaveGroup (WsfGroup *aGroupPtr)
 Leave the given group.
bool IsGroupMember (WsfStringId aGroupId)
unsigned int GetUpdateEventEpoch () const
void IncrementUpdateEventEpoch ()
bool UpdateEventActive () const
 Is an 'Update' event active?
void SetUpdateEventActive (bool aUpdateEventActive)
 Indicate if the 'Update' event is active.
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
Public Member Functions inherited from WsfUniqueId
 WsfUniqueId ()
 Construtor initializes the unique identifier to 0.
 WsfUniqueId (const WsfUniqueId &)
 Copy constructor initializes the unique identifier to 0.
WsfUniqueIdoperator= (const WsfUniqueId &)
unsigned int GetUniqueId () const
 Get the unique identifier assigned to this object.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
Public Member Functions inherited from WsfAuxDataEnabled
 WsfAuxDataEnabled ()=default
 WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default
WsfAuxDataEnabledoperator= (const WsfAuxDataEnabled &aRhs)
 WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default
WsfAuxDataEnabledoperator= (WsfAuxDataEnabled &&)=default
virtual ~WsfAuxDataEnabled () noexcept
void SetAuxData (const WsfAttributeContainer &aAuxData)
void DeleteAuxData ()
 Delete the aux data container from the object.
void MergeAuxData (const WsfAuxDataEnabled &aSrc)
 Merge the object's aux data with aux data from an existing object.
void UpdateAuxData (const WsfAuxDataEnabled &aSrc)
 Update the object's aux data with aux data from an existing object.
bool HasAuxData () const
 Returns true if this object has aux data.
bool ProcessInput (UtInput &aInput)
template<typename T>
void Serialize (T &aBuff)
 (De)serialization for XIO
WsfAttributeContainerGetAuxData ()
const WsfAttributeContainerGetAuxData () const noexcept
const WsfAttributeContainerGetAuxDataConst () const noexcept

Callbacks

These callbacks may be attached to, but should only be called from WsfTaskManager internally.

UtCallbackListN< void(double, WsfTask &, const WsfTrack &)> OnTaskAssigned
 Executes when an assigned task is accepted (by this processor).
UtCallbackListN< void(double, WsfTask &)> OnTaskCanceled
 Executes when a task cancel message is processed.
UtCallbackListN< void(double, WsfTask &)> OnTaskCompleted
 Executes when an task complete is received.
UtCallbackListN< void(double, WsfTask &, const WsfTrack &)> OnTaskAssignSent
 Executes when a task assignment is sent.
UtCallbackListN< void(double, WsfTask &, WsfStringId)> OnTaskCompleteSent
 Executes when a task complete is sent.
UtCallbackListN< void(double, WsfTask &)> OnTaskCancelSent
 Executes when a task cancel is sent.

Message handlers

WsfTrackManagermTrackManagerPtr
 The track manager that owns the tracks.
std::unique_ptr< WsfTimeDelayQueuemThinkerPtr
 The pointer to the 'thinker'.
PendingMessageList mPendingMessageList
TrackList mActiveTrackList
SensorRequestList mSensorRequestList
std::map< WsfStringId, int > mOperatingLevels
std::set< WsfSensor * > mSensorsTurnedOn
 The sensors that have been implicitly turned on.
WsfScenariomScenarioPtr
UtCallbackHolder mCallbacks
TaskList mXmtdTaskList
 Tasks I have sent to others.
TaskList mPurgedXmtdTaskList
TaskList mRcvdTaskList
 Tasks I have received from others.
TaskList mPurgedRcvdTaskList
std::set< WsfTrackIdmPendingRcvdTasks
 The set of assigned track ID's that are awaiting correlation with local track ID's.
WsfStringId mTrackProcessorName
 The name of the track processor whose track manager is the source of tracks.
double mTrackUpdateInterval
WsfRandomVariable mTimeToRecognizeMessage
 The amount of time it takes to recognize a message.
double mCommRetryInterval
 The amount of time between attempts to retry failed communications.
int mCommRetryAttempts
 The number of attempts to retry failed communications.
unsigned int mNextTaskId
 The next task ID to be assigned.
bool mShowTaskMessages
 True if task related messages are to be displayed.
bool mShowUncompletedTasks
 True if leak termination data is to be shown.
TrackUpdateStrategy mTrackUpdateStrategy
 Determine how track updates are sent.
double mTimeLastTaskAssigned
 The time a task was last sent.
double mTimeLastTaskReceived
 The time a task was last received.
virtual bool ProcessAssociationMessage (double aSimTime, const WsfAssociationMessage &aMessage)
virtual bool ProcessTaskAssignMessage (double aSimTime, const WsfTaskAssignMessage &aMessage)
virtual bool ProcessTaskCancelMessage (double aSimTime, const WsfTaskCancelMessage &aMessage)
virtual bool ProcessTaskControlMessage (double aSimTime, const WsfTaskControlMessage &aMessage)
virtual bool ProcessTaskStatusMessage (double aSimTime, const WsfTaskStatusMessage &aMessage)
virtual bool ProcessTrackDropMessage (double aSimTime, const WsfTrackDropMessage &aMessage)
 any sensor tasks for the dropped track will be reported complete/successful
virtual bool ProcessTrackMessage (double aSimTime, const WsfTrackMessage &aMessage)

Common framework methods

WsfProcessorClone () const override
 A virtual copy constructor.
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
bool PreInitialize (double aSimTime) override
bool Initialize (double aSimTime) override
bool Initialize2 (double aSimTime) override
bool ProcessInput (UtInput &aInput) override
void PlatformDeleted (WsfPlatform *aPlatformPtr) override
bool ProcessMessage (double aSimTime, const WsfMessage &aMessage) override
bool ReceiveMessage (double aSimTime, const WsfMessage &aMessage) override
void TurnOff (double aSimTime) override
void TurnOn (double aSimTime) override
void Update (double aSimTime) override

Command methods.

virtual bool AssignTask (double aSimTime, const WsfTrack &aTrack, const WsfTask &aTask, bool aLockTrack=true)
virtual bool AssignTask (double aSimTime, const WsfTrack &aTrack, WsfStringId aTaskType, const WsfTaskResource &aResource, WsfPlatform *aAssigneePtr, WsfStringId aCommName)
virtual bool CancelTask (double aSimTime, unsigned int aTaskId)
virtual void CancelTask (double aSimTime, WsfTask &aTask, bool aSendCancelMessage)
virtual bool CancelTask (double aSimTime, const WsfTrackId &aTrackId, WsfStringId aTaskType, const WsfTaskResource &aResource, size_t aAssigneeIndex)
virtual bool CreateDelayTask (double aSimTime, double aDelayTime, const WsfTrack &aTrack, WsfStringId aTaskType)
virtual bool ChangeOperatingLevel (double aSimTime, WsfStringId aName, int aLevel, WsfPlatform *aAssigneePtr, WsfStringId aCommName)
 Change the operating level for a given subordinate.

Reporting methods.

These methods are used by task assignees to report completion or progress of a task.

virtual bool ReportTaskComplete (double aSimTime, const WsfTrackId &aTrackId, WsfStringId aTaskType, WsfStringId aResourceName, WsfStringId aSubStatus)
virtual bool ReportTaskProgress (double aSimTime, const WsfTrackId &aTrackId, WsfStringId aTaskType, WsfStringId aResourceName, WsfStringId aSubStatus)

Query methods

void AssigneesForTask (const WsfTrackId &aTrackId, WsfStringId aTaskType, std::vector< size_t > &aAssignees) const
size_t AssigneeForTask (const WsfTrackId &aTrackId, WsfStringId aTaskType, WsfStringId aResourceName) const
int OperatingLevelFor (WsfStringId aConditionName) const
 Return the current operating level for the specified condition name or status.
int TasksAssignedTo (size_t aAssigneeIndex, const WsfTrackId &aTrackId, WsfStringId aTaskType, WsfStringId aResourceName) const
int TasksAssignedFor (const WsfTrackId &aTrackId, WsfStringId aTaskType, WsfStringId aResourceName) const
int TasksReceivedFor (const WsfTrackId &aTrackId, WsfStringId aTaskType, WsfStringId aResourceName) const
double TimeTaskAssigned (const WsfTrackId &aTrackId, WsfStringId aTaskType, size_t aAssigneeIndex) const
 Return the simulation time when a task was assigned.
TaskListAssignedTaskList ()
 Return the list of tasks this TaskManager has assigned.
TaskListReceivedTaskList ()
 Return the list of tasks this TaskManager has received.
double TimeLastTaskAssigned () const
double TimeLastTaskReceived () const
static TaskList::iterator FindTask (TaskList &aTaskList, size_t aAssigneeIndex, const WsfTrackId &aTrackId, WsfStringId aTaskType, WsfStringId aResourceName)
static TaskList::iterator FindTask (TaskList &aTaskList, unsigned int aTaskId)
static TaskList::iterator FindTask (TaskList &aTaskList, unsigned int aTaskId, size_t aAssigneeIndex)

Internal methods.

These methods are not intended for public use.

void CheckMessageAcknowledged (double aSimTime, unsigned int aSerialNumber)
bool SendTaskMessage (double aSimTime, const WsfMessage &aMessage, size_t aRecipientIndex, WsfStringId aCommName, bool aReliable)
double SendTrackUpdate (double aSimTime, unsigned int aTaskId)
WsfStringId SelectCommDevice (WsfPlatform *aAssigneePtr, WsfStringId aCommName)
const TrackListActiveTrackList () const
 Return the list of tasks this TaskManager has active.
bool ShowTaskMessages () const

Events.

Some are public because they are used by derived classes or extensions. Others are private and exist with anonymous namespaces.

 WsfTaskManager (const WsfTaskManager &aSrc)
 Copy constructor.
virtual bool AcquireResource (double aSimTime, WsfTask &aTask, const WsfTrack &aTrack)
virtual bool ReleaseResource (double aSimTime, WsfTask &aTask)
virtual void TaskCanceled (double aSimTime, WsfTask &aTask)
virtual void TaskCompleted (double aSimTime, WsfTask &aTask)
virtual void TaskAssignSent (double aSimTime, const WsfTrack &aTrack, WsfTask &aTask)
virtual void TaskAssigned (double aSimTime, const WsfTrack &aTrack, WsfTask &aTask)
virtual void TaskCorrelated (double aSimTime, WsfTask &aTask)
 Called when a task has been correlated with a local track.
virtual void OperatingLevelChanged (double aSimTime, std::string aLevel)
virtual void TrackDropped (double aSimTime, const WsfTrackId &aTrackId)
bool DropFromPurgedTaskList (TaskList &aPurgedTaskList, size_t aAssignerIndex, unsigned int aTaskId)
bool GetMessageSender (const WsfMessage &aMessage, size_t &aSenderIndex, WsfStringId &aRcvrCommName)
 Given a message, get the platform index of the sender and the local device on which the message was received.
void MessageAcknowledged (unsigned int aSerialNumber)

Additional Inherited Members

Static Public Attributes inherited from WsfAuxDataEnabled
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataAccessed
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataDestroyed
Protected Member Functions inherited from WsfScriptProcessor
 WsfScriptProcessor (const WsfScriptProcessor &aSrc)
 WsfProcessor (const WsfProcessor &aSrc)
 Copy constructor (for Clone()).
WsfProcessoroperator= (const WsfProcessor &aRhs)=delete
 WsfPlatformPart (const WsfPlatformPart &aSrc)
 Copy constructor (for Clone()).
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).
Protected Member Functions inherited from WsfUniqueId
void AssignUniqueId (WsfSimulation *aSimulationPtr)
Protected Attributes inherited from WsfScriptProcessor
WsfScriptContextmContextPtr
 Pointer to the script context.
WsfScriptMessageHandlermMessageHandlerPtr
 Pointer to the 'on_message' handler.
UtScript * mOnMessageCreateScriptPtr
 Pointer to the 'on_message_create' script.
UtScriptClass * mMessageClassPtr
wsf::ExternalLinks mExternalLinks
 The external recipients.
WsfBehaviorTreemBehaviorTreePtr
ut::CloneablePtr< WsfAdvancedBehaviorTreemAdvancedBehaviorTreePtr
std::unique_ptr< WsfScriptStateMachinemStateMachinePtr
int mStateIndex
bool mSuppressMessage

Detailed Description

WsfTaskManager is a class for task control.

This class uses WsfTaskManagerBase for basic bookkeeping functions for sending and receiving task assignments and the status information dealing with those assignments.

This class implements various script features, like callbacks, for task events.

In this implementation tasks are always associated with a track, and the track ID and an optional user-selected 'task-type' are used to identify a task.

Member Typedef Documentation

◆ PendingMessageList

◆ RoleIterator

◆ SensorRequestList

◆ TaskList

using WsfTaskManager::TaskList = std::list<WsfTask>

◆ TrackList

◆ TrackListIter

using WsfTaskManager::TrackListIter = std::list<ActiveTrack>::iterator

Member Enumeration Documentation

◆ TrackUpdateStrategy

Enumerator
cDEFAULT 
cBATCH 

Constructor & Destructor Documentation

◆ WsfTaskManager() [1/2]

◆ ~WsfTaskManager()

◆ WsfTaskManager() [2/2]

Member Function Documentation

◆ AcquireResource()

◆ ActiveTrackList()

const TrackList & WsfTaskManager::ActiveTrackList ( ) const
inline

Return the list of tasks this TaskManager has active.

References mActiveTrackList.

◆ AssignedTaskList()

TaskList & WsfTaskManager::AssignedTaskList ( )
inline

Return the list of tasks this TaskManager has assigned.

References mXmtdTaskList.

Referenced by WsfXIO_TaskService::SendInitial().

◆ AssigneeForTask()

size_t WsfTaskManager::AssigneeForTask ( const WsfTrackId & aTrackId,
WsfStringId aTaskType,
WsfStringId aResourceName ) const

Return the platform (index) of the assignee for the specified task.

Parameters
aTrackIdThe local track ID of the task of interest.
aTaskTypeThe task type of the task of interest.
aResourceNameThe name (ID) of the resource of interest.
Returns
The platform index of the assignee, which can be zero.

References mXmtdTaskList.

Referenced by ~WsfTaskManager().

◆ AssigneesForTask()

void WsfTaskManager::AssigneesForTask ( const WsfTrackId & aTrackId,
WsfStringId aTaskType,
std::vector< size_t > & aAssignees ) const

Return the list of platform (indexes) of the assignees for the specified task.

Parameters
aTrackIdThe local track ID of the track of interest. If null then the track ID is not a selection criteria.
aTaskTypeThe task type of the tasks to be counted. If zero then the task type is not a selection criteria.
aAssigneesThe indexes of the platforms that have been assigned to the specified task.

References WsfTrackId::IsNull(), and mXmtdTaskList.

Referenced by ~WsfTaskManager().

◆ AssignTask() [1/2]

bool WsfTaskManager::AssignTask ( double aSimTime,
const WsfTrack & aTrack,
const WsfTask & aTask,
bool aLockTrack = true )
virtual

◆ AssignTask() [2/2]

bool WsfTaskManager::AssignTask ( double aSimTime,
const WsfTrack & aTrack,
WsfStringId aTaskType,
const WsfTaskResource & aResource,
WsfPlatform * aAssigneePtr,
WsfStringId aCommName )
virtual

Assign a task.

Parameters
aSimTimeThe current simulation time.
aTrackThe track that represents the objective of the assignment.
aTaskTypeThe 'type' of the task.
aResourceThe resource specification of the resource to be allocated.
aAssigneePtrA pointer to the platform to be assigned to the task.
aCommNameThe name (as a string ID) of the communications device to be used to send the task assignment.

References AssignTask(), WsfTask::SetAssignee(), WsfTask::SetCommName(), and WsfTask::SetTaskType().

◆ CancelTask() [1/3]

bool WsfTaskManager::CancelTask ( double aSimTime,
const WsfTrackId & aTrackId,
WsfStringId aTaskType,
const WsfTaskResource & aResource,
size_t aAssigneeIndex )
virtual

Cancel tasks and subtasks.

Parameters
aSimTimeThe current simulation time.
aTrackIdThe track ID of the task(s) to be canceled.
aTaskTypeThe task type of the tasks to be canceled. If zero then the task type is not a selection criteria.
aResourceThe associated resource of the task to be canceled. If a resource name is not specified it is not a selection criteria.
aAssigneeIndexThe platform index to which the task is assigned. If zero then the assignee is not a selection criteria.

References CancelTask(), WsfTask::GetAssigneePlatformIndex(), WsfTask::GetLocalTrackId(), WsfTask::GetResource(), WsfTask::GetTaskType(), WsfTask::GetTrackId(), WsfTaskResource::IsMatch(), WsfTrackId::IsNull(), and mXmtdTaskList.

◆ CancelTask() [2/3]

bool WsfTaskManager::CancelTask ( double aSimTime,
unsigned int aTaskId )
virtual

◆ CancelTask() [3/3]

void WsfTaskManager::CancelTask ( double aSimTime,
WsfTask & aTask,
bool aSendCancelMessage )
virtual

An internal routine to cancel a task that we have assigned. This routine sends the cancel message for the indicated task.

Note
The caller is responsible for removing the task from the task list.
Parameters
aSimTimeThe current simulation time.
aTaskThe task to be canceled.
aSendCancelMessage'true' if a cancel message should be sent to the assignee.

References WsfTask::GetAssigneePlatformIndex(), WsfTask::GetAssigneePlatformName(), WsfTask::GetCommName(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTask::GetResource(), WsfTask::GetResourceName(), WsfPlatformPart::GetSimulation(), WsfTask::GetTargetName(), WsfTask::GetTaskType(), WsfTask::GetTrackId(), WsfTaskResource::GetTypeName(), WsfScriptProcessor::mContextPtr, mPurgedXmtdTaskList, mShowTaskMessages, OnTaskCancelSent, SendTaskMessage(), and WsfObserver::TaskCanceled().

◆ ChangeOperatingLevel()

bool WsfTaskManager::ChangeOperatingLevel ( double aSimTime,
WsfStringId aName,
int aLevel,
WsfPlatform * aAssigneePtr,
WsfStringId aCommName )
virtual

◆ CheckMessageAcknowledged()

◆ Clone()

WsfProcessor * WsfTaskManager::Clone ( ) const
overridevirtual

◆ CreateDelayTask()

bool WsfTaskManager::CreateDelayTask ( double aSimTime,
double aDelayTime,
const WsfTrack & aTrack,
WsfStringId aTaskType )
virtual

Create and Assign a delay task. A delay task is a pseudo-task that simply reports complete after a specified time interval. has elapsed.

Parameters
aSimTimeThe current simulation time.
aDelayTimeThe amount of time to delay.
aTrackThe track that represents the objective of the assignment. In theory this could be a track ID, but we want this to look like an AssignTask request.
aTaskTypeThe 'type' of the task.

References WsfSimulation::AddEvent(), AssignTask(), FindTask(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetSimulation(), WsfTrack::GetTrackId(), mRcvdTaskList, and mXmtdTaskList.

Referenced by ~WsfTaskManager().

◆ DropFromPurgedTaskList()

bool WsfTaskManager::DropFromPurgedTaskList ( TaskList & aPurgedTaskList,
size_t aAssignerIndex,
unsigned int aTaskId )
protected

Drop an entry from the purged task list. This is called when the conditions have been met that allow an entry to be deleted from the purged task list (i.e. receipt of a task cancel/completion or the corresponding acknowledgment of a task cancel/completion.

Parameters
aPurgedTaskListEither the transmitted or received purged task list.
aAssignerIndexThe platform index of the task assigner.
aTaskIdThe assigners task ID.
Returns
true if found and dropped from the purged task list or 'false' if an entry does not exist.

References WsfTask::GetAssignerPlatformIndex(), WsfTaskCancelMessage::GetAssignerPlatformIndex(), WsfTaskStatusMessage::GetAssignerPlatformIndex(), WsfTask::GetTaskId(), WsfTaskCancelMessage::GetTaskId(), WsfTaskStatusMessage::GetTaskId(), WsfMessage::GetType(), WsfTaskCancelMessage::GetTypeId(), WsfTaskStatusMessage::GetTypeId(), WsfTaskManager::PendingMessage::mMessagePtr, and mPendingMessageList.

Referenced by ProcessTaskCancelMessage(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), and WsfQuantumTaskerProcessor::RejectTask().

◆ FindTask() [1/3]

WsfTaskManager::TaskList::iterator WsfTaskManager::FindTask ( TaskList & aTaskList,
size_t aAssigneeIndex,
const WsfTrackId & aTrackId,
WsfStringId aTaskType,
WsfStringId aResourceName )
static

Find a task with the specified task ID, assignee name and resource Id.

Parameters
aTaskListThe task list to be searched.
aAssigneeIndexThe platform index of the assignee to the task.
aTrackIdThe task ID of the task to be located.
aTaskTypeThe type of the task to be located.
aResourceNameThe resource ID of the task to be located.
Returns
An iterator for the located task or aTaskList.end() if the task could not be found.

Referenced by AssignTask(), WsfWeaponTaskManager::AssignTask(), CancelTask(), CheckMessageAcknowledged(), CreateDelayTask(), ProcessTaskAssignMessage(), ProcessTaskCancelMessage(), ProcessTaskStatusMessage(), ReportTaskComplete(), ReportTaskProgress(), WsfWeaponTaskManager::StartingWeaponTask(), and WsfWeaponTaskManager::UplinkStart().

◆ FindTask() [2/3]

WsfTaskManager::TaskList::iterator WsfTaskManager::FindTask ( TaskList & aTaskList,
unsigned int aTaskId )
static

Find a task with the specified task ID

Parameters
aTaskListThe task list to be searched.
aTaskIdThe task ID of the task to be located.
Returns
An iterator for the located task or aTaskList.end() if the task could not be found.

◆ FindTask() [3/3]

WsfTaskManager::TaskList::iterator WsfTaskManager::FindTask ( TaskList & aTaskList,
unsigned int aTaskId,
size_t aAssigneeIndex )
static

◆ GetComponentRoles()

const int * WsfTaskManager::GetComponentRoles ( ) const
overridevirtual

Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:

return roles;
@ cWSF_COMPONENT_SENSOR
A 'sensor' component (WsfSensor).
Definition WsfComponentRoles.hpp:105
@ cWSF_COMPONENT_PLATFORM_PART
The component derives from WsfPlatformPart.
Definition WsfComponentRoles.hpp:98
@ cWSF_COMPONENT_ARTICULATED_PART
The component derives from WsfArticulatedPart.
Definition WsfComponentRoles.hpp:99

Reimplemented from WsfProcessor.

References cWSF_COMPONENT_NULL, cWSF_COMPONENT_PLATFORM_PART, cWSF_COMPONENT_PROCESSOR, and cWSF_COMPONENT_TASK_MANAGER.

Referenced by ~WsfTaskManager().

◆ GetMessageSender()

bool WsfTaskManager::GetMessageSender ( const WsfMessage & aMessage,
size_t & aSenderIndex,
WsfStringId & aRcvrCommName )
protected

◆ GetScriptClassName()

const char * WsfTaskManager::GetScriptClassName ( ) const
override

Referenced by ~WsfTaskManager().

◆ Initialize()

bool WsfTaskManager::Initialize ( double aSimTime)
overridevirtual

Perform phase 1 initialization of the part. This is invoked by WsfPlatform::Initialize() during phase 1 initialization of the platform. During phase 1 initialization, platform components must not assume the existence of ANY data that is the responsibility of another platform component. In particular, the platform location and initial tracks cannot be assumed to be valid.

Parameters
aSimTimeThe current simulation time.
Returns
'true' if successful or 'false' if some sort of error occurred.

Reimplemented from WsfScriptProcessor.

Reimplemented in WsfTaskProcessor.

References WsfPlatformPart::GetPlatform(), WsfScriptProcessor::GetScriptContext(), WsfScriptProcessor::Initialize(), mThinkerPtr, and ok.

Referenced by WsfQuantumTaskerProcessor::Initialize(), WsfTaskProcessor::Initialize(), and ~WsfTaskManager().

◆ Initialize2()

bool WsfTaskManager::Initialize2 ( double aSimTime)
overridevirtual

Perform phase 2 initialization of the part. This is invoked by WsfPlatform::Initialize() during phase 2 initialization of the platform. During phase 2, platform components may assume that the platform location has been defined, initial tracks have been loaded and that all components have completed phase 1 initialization.

Parameters
aSimTimeThe current simulation time.
Returns
'true' if successful or 'false' if some sort of error occurred.

Reimplemented from WsfScriptProcessor.

Reimplemented in WsfTaskProcessor.

References WsfPlatformPart::DebugEnabled(), WsfComponentList::GetComponent(), WsfPlatformPart::GetPlatform(), WsfPlatform::GetTrackManager(), WsfTrackProcessor::GetTrackManager(), WsfScriptProcessor::Initialize2(), mCallbacks, WsfScriptProcessor::mContextPtr, mShowTaskMessages, mShowUncompletedTasks, mTrackManagerPtr, mTrackProcessorName, ok, and WsfProcessor::WsfProcessor().

Referenced by WsfQuantumTaskerProcessor::Initialize2(), WsfTaskProcessor::Initialize2(), and ~WsfTaskManager().

◆ MessageAcknowledged()

void WsfTaskManager::MessageAcknowledged ( unsigned int aSerialNumber)
protected

The acknowledgment for the specified message has been received.

Parameters
aSerialNumberThe serial number of the message that has been acknowledged.

References WsfMessage::GetSerialNumber(), WsfTaskManager::PendingMessage::mMessagePtr, and mPendingMessageList.

Referenced by WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), and ProcessTaskStatusMessage().

◆ OperatingLevelChanged()

void WsfTaskManager::OperatingLevelChanged ( double aSimTime,
std::string aLevel )
protectedvirtual

◆ OperatingLevelFor()

int WsfTaskManager::OperatingLevelFor ( WsfStringId aConditionName) const

Return the current operating level for the specified condition name or status.

References mOperatingLevels.

Referenced by UT_DEFINE_SCRIPT_METHOD(), and ~WsfTaskManager().

◆ operator=()

WsfTaskManager & WsfTaskManager::operator= ( const WsfTaskManager & )
delete

References WsfTaskManager().

◆ PlatformDeleted()

void WsfTaskManager::PlatformDeleted ( WsfPlatform * aPlatformPtr)
overridevirtual

Some other platform has been deleted from the simulation.

This is invoked (via WsfPlatform::PlatformDeleted) whenever another platform has been deleted from the simulation.

Parameters
aPlatformPtrPointer to the platform being deleted.

Reimplemented from WsfPlatformPart.

Reimplemented in WsfTaskProcessor.

References CancelTask(), WsfProcessor::GetComponents(), WsfPlatform::GetIndex(), WsfPlatformPart::GetSimulation(), and mXmtdTaskList.

Referenced by WsfQuantumTaskerProcessor::PlatformDeleted(), WsfTaskProcessor::PlatformDeleted(), and ~WsfTaskManager().

◆ PreInitialize()

bool WsfTaskManager::PreInitialize ( double aSimTime)
overridevirtual

Perform pre-initializion function. This is called by WsfPlatform::Initialize prior to actually initializing the components on a platform (i.e.: calling Initialize and Initialize2 for each component). The primary reason for this method is to allow components to add other components that will then be subsequently initialized. The component may examine the component list and add components, but it must not assume ANYTHING about the actual state of the component.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)

Reimplemented from WsfProcessor.

References ok, and WsfProcessor::PreInitialize().

Referenced by WsfQuantumTaskerProcessor::PreInitialize(), and ~WsfTaskManager().

◆ ProcessAssociationMessage()

bool WsfTaskManager::ProcessAssociationMessage ( double aSimTime,
const WsfAssociationMessage & aMessage )
protectedvirtual

Process the sensor track request association message.

When a sensor initiates a track that is the result of StartTracking() request, it will send a WSF_TRACK_ASSOCIATION_MESSAGE prior to sending the first WSF_TRACK_MESSAGE. This information provides the track ID of the StartTracking() request and the track ID of the track that is being produced as a result of that request.

Returns
'false' to allow other message listeners to look at the message.

References WsfAssociationMessage::GetAssociatedId(), WsfProcessor::GetComponents(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfAssociationMessage::GetSensorName(), WsfAssociationMessage::GetSubjectId(), mActiveTrackList, WsfTaskManager::ActiveTrack::mSensorName, WsfTaskManager::ActiveTrack::mSensorTrackId, mShowTaskMessages, WsfTaskManager::ActiveTrack::mTaskTrackId, and ok.

Referenced by ProcessMessage().

◆ ProcessInput()

bool WsfTaskManager::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfScriptProcessor.

Reimplemented in WsfTaskProcessor.

References cBATCH, cDEFAULT, mCommRetryAttempts, mCommRetryInterval, mOperatingLevels, mShowTaskMessages, mShowUncompletedTasks, mThinkerPtr, mTimeToRecognizeMessage, mTrackProcessorName, mTrackUpdateInterval, mTrackUpdateStrategy, and WsfScriptProcessor::ProcessInput().

Referenced by WsfQuantumTaskerProcessor::ProcessInput(), WsfTaskProcessor::ProcessInput(), and ~WsfTaskManager().

◆ ProcessMessage()

bool WsfTaskManager::ProcessMessage ( double aSimTime,
const WsfMessage & aMessage )
overridevirtual

Process a received message.

Parameters
aSimTimeThe current simulation time.
aMessageThe message that is being sent.
Returns
'true' if the message was processed or 'false' if not.
Note
A message is first received by ReceiveMessage which then calls ProcessMessage to process the message. A derived class ReceiveMessage method may choose to delay the message before calling ProcessMessage or may choose to ignore the message altogether.

Reimplemented from WsfScriptProcessor.

Reimplemented in WsfTaskProcessor.

References WsfStringTable::cWSF_ASSOCIATION_MESSAGE, WsfStringTable::cWSF_DROP_TRACK_MESSAGE, WsfStringTable::cWSF_TASK_ASSIGN_MESSAGE, WsfStringTable::cWSF_TASK_CANCEL_MESSAGE, WsfStringTable::cWSF_TASK_CONTROL_MESSAGE, WsfStringTable::cWSF_TASK_STATUS_MESSAGE, WsfStringTable::cWSF_TRACK_MESSAGE, WsfMessage::GetType(), mScenarioPtr, ProcessAssociationMessage(), ProcessTaskAssignMessage(), ProcessTaskCancelMessage(), ProcessTaskControlMessage(), ProcessTaskStatusMessage(), ProcessTrackDropMessage(), and ProcessTrackMessage().

Referenced by WsfQuantumTaskerProcessor::ProcessMessage(), WsfTaskProcessor::ProcessMessage(), ReceiveMessage(), SendTaskMessage(), and ~WsfTaskManager().

◆ ProcessTaskAssignMessage()

◆ ProcessTaskCancelMessage()

◆ ProcessTaskControlMessage()

◆ ProcessTaskStatusMessage()

◆ ProcessTrackDropMessage()

bool WsfTaskManager::ProcessTrackDropMessage ( double aSimTime,
const WsfTrackDropMessage & aMessage )
protectedvirtual

any sensor tasks for the dropped track will be reported complete/successful

References WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTrackDropMessage::GetTrackId(), mActiveTrackList, mRcvdTaskList, mScenarioPtr, mShowTaskMessages, and ReportTaskComplete().

Referenced by ProcessMessage().

◆ ProcessTrackMessage()

bool WsfTaskManager::ProcessTrackMessage ( double aSimTime,
const WsfTrackMessage & aMessage )
protectedvirtual

Referenced by ProcessMessage().

◆ QueryInterface()

void * WsfTaskManager::QueryInterface ( int aRole)
overridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Reimplemented from WsfProcessor.

References cWSF_COMPONENT_TASK_MANAGER, and WsfProcessor::QueryInterface().

Referenced by ~WsfTaskManager().

◆ ReceivedTaskList()

TaskList & WsfTaskManager::ReceivedTaskList ( )
inline

Return the list of tasks this TaskManager has received.

References mRcvdTaskList.

Referenced by WsfXIO_TaskService::SendInitial().

◆ ReceiveMessage()

bool WsfTaskManager::ReceiveMessage ( double aSimTime,
const WsfMessage & aMessage )
overridevirtual

Receive a message from another platform part (system). The default implementation simply calls ProcessMessage to process the received message.

Parameters
aSimTimeThe current simulation time.
aMessageThe message that is being sent.
Returns
'true' if the message was received or 'false' if not.
Note
A message is first received by ReceiveMessage which then calls ProcessMessage to process the message. A derived class ReceiveMessage method may choose to delay the message before calling ProcessMessage or may choose to ignore the message altogether.

Reimplemented from WsfPlatformPart.

References WsfTaskStatusMessage::GetAcknowledgeId(), WsfTask::GetAssigneePlatformIndex(), WsfTaskCancelMessage::GetAssigneePlatformIndex(), WsfTaskControlMessage::GetAssigneePlatformIndex(), WsfTaskStatusMessage::GetAssigneePlatformIndex(), WsfTask::GetAssigneeProcessorName(), WsfTaskCancelMessage::GetAssigneeProcessorName(), WsfTaskControlMessage::GetAssigneeProcessorName(), WsfTaskStatusMessage::GetAssigneeProcessorName(), WsfTaskStatusMessage::GetAssignerPlatformIndex(), WsfTaskStatusMessage::GetAssignerProcessorName(), WsfObject::GetNameId(), WsfPlatformPart::GetPlatform(), WsfTaskAssignMessage::GetTask(), WsfMessage::GetType(), WsfTaskStatusMessage::IsFromAssignee(), mScenarioPtr, mThinkerPtr, mTimeToRecognizeMessage, and ProcessMessage().

Referenced by WsfQuantumTaskerProcessor::ReceiveMessage(), and ~WsfTaskManager().

◆ ReleaseResource()

◆ ReportTaskComplete()

◆ ReportTaskProgress()

◆ SelectCommDevice()

WsfStringId WsfTaskManager::SelectCommDevice ( WsfPlatform * aRecipientPtr,
WsfStringId aCommName )

Internal method to select a comm device if one wasn't explicitly provided. If the assignee platform is not the same as the assigner platform and if a comm device was not explicitly selected, then attempt to choose a comm device over which a message can be sent to the assignee.

Parameters
aRecipientPtrThe intended recipient.
aCommNameThe supplied comm device (or zero if to be determined).
Returns
The name (string ID) of the comm device to be used.

References WsfPlatformPart::GetPlatform(), and wsf::comm::util::SelectDevice().

Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), ChangeOperatingLevel(), and WsfQuantumTaskerProcessor::RejectTask().

◆ SendTaskMessage()

bool WsfTaskManager::SendTaskMessage ( double aSimTime,
const WsfMessage & aMessage,
size_t aRecipientIndex,
WsfStringId aCommName,
bool aReliable )

Attempt to send a message. This routine will send a message to the desired recipient. If the recipient of the message is the same as the sending platform then this processors ProcessMessage() method will be called to handle the message.

Parameters
aSimTimeThe current simulation time.
aMessageThe message to be sent.
aRecipientIndexThe platform index of the recipient.
aCommNameFor an inter-platform message, this is the name (string ID) of the communications device over which the message is to be sent. For an intra-platform message, this is the name (string ID) of the processor to whom the message is intended.
aReliableIf true, the message must be delivered 'reliably'. The message will be retransmitted (if allowed) until the receiver responds with a message indicating they received the message.

Determine the destination comm. We select any comm that is the same network and belongs to the destination.

References WsfSimulation::AddEvent(), WsfComponentList::RoleIterator< T >::AtEnd(), wsf::comm::Comm::GetAddress(), wsf::comm::NetworkManager::GetAddressesInNetwork(), wsf::comm::NetworkManager::GetComm(), WsfSimulation::GetCommNetworkManager(), WsfComponentList::GetComponent(), WsfPlatform::GetComponents(), WsfObject::GetName(), WsfNamed::GetNameId(), WsfObject::GetNameId(), wsf::comm::Comm::GetNetwork(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfSimulation::GetPlatformNameId(), WsfMessage::GetSerialNumber(), WsfPlatformPart::GetSimulation(), mCommRetryAttempts, mCommRetryInterval, mPendingMessageList, ProcessMessage(), WsfPlatformPart::ReceiveMessage(), wsf::comm::Comm::Send(), WsfMessage::SetGroup(), and WsfProcessor::WsfProcessor().

Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), CancelTask(), ChangeOperatingLevel(), CheckMessageAcknowledged(), WsfQuantumTaskerProcessor::ProcessTaskAssignMessage(), ProcessTaskAssignMessage(), ProcessTaskCancelMessage(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfQuantumTaskerProcessor::RejectTask(), ReportTaskComplete(), ReportTaskProgress(), and SendTrackUpdate().

◆ SendTrackUpdate()

double WsfTaskManager::SendTrackUpdate ( double aSimTime,
unsigned int aTaskId )

Internal method to send a track update to an assignee. This method is invoked by a periodic TrackUpdateEvent to send the most current track to the assignee.

Parameters
aSimTimeThe current simulation time.
aTaskIdThe unique identifier for the task.
Returns
The simulation time when the next track update should be sent. The return value is less than zero if no further updates should be sent.
Note
This is not part of the external interface, and should not be called by users.

References WsfPlatformPart::DebugEnabled(), WsfTask::GetAssigneePlatformIndex(), WsfTask::GetAssigneePlatformName(), WsfTask::GetCommName(), WsfTask::GetLocalTrackId(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTask::GetTaskId(), mTrackManagerPtr, mTrackUpdateInterval, mXmtdTaskList, SendTaskMessage(), and trackPtr.

Referenced by WsfTaskManager::TrackUpdateEvent::ExecuteEvent().

◆ ShowTaskMessages()

bool WsfTaskManager::ShowTaskMessages ( ) const
inline

References mShowTaskMessages.

◆ TaskAssigned()

void WsfTaskManager::TaskAssigned ( double aSimTime,
const WsfTrack & aTrack,
WsfTask & aTask )
protectedvirtual

◆ TaskAssignSent()

void WsfTaskManager::TaskAssignSent ( double aSimTime,
const WsfTrack & aTrack,
WsfTask & aTask )
protectedvirtual

◆ TaskCanceled()

void WsfTaskManager::TaskCanceled ( double aSimTime,
WsfTask & aTask )
protectedvirtual

◆ TaskCompleted()

◆ TaskCorrelated()

void WsfTaskManager::TaskCorrelated ( double aSimTime,
WsfTask & aTask )
protectedvirtual

Called when a task has been correlated with a local track.

References WsfProcessor::GetComponents().

Referenced by ProcessTaskAssignMessage(), and WsfQuantumTaskerProcessor::UpdateTaskCorrelation().

◆ TasksAssignedFor()

int WsfTaskManager::TasksAssignedFor ( const WsfTrackId & aTrackId,
WsfStringId aTaskType,
WsfStringId aResourceName ) const

Return the count of the number of tasks that have been assigned to the specified track.

Parameters
aTrackIdThe local track ID of the track of interest.
aTaskTypeThe task type of the tasks to be counted. If zero then the task type is not a selection criteria.
aResourceNameThe resource name ID (sensor/processor) of the task to be counted. If zero then resource name is not a selection criteria.
Returns
The number of tasks that have been assigned.

References WsfTrackId::IsNull(), and mXmtdTaskList.

Referenced by WsfRF_Repeater::SensorTrackDropped(), and ~WsfTaskManager().

◆ TasksAssignedTo()

int WsfTaskManager::TasksAssignedTo ( size_t aAssigneeIndex,
const WsfTrackId & aTrackId,
WsfStringId aTaskType,
WsfStringId aResourceName ) const

Return the count of the number of tasks that have been assigned to the specified subordinate.

Parameters
aAssigneeIndexThe platform index of the assigned platform to be queried.
aTrackIdThe local track ID of the track of interest. If null then the track ID is not a selection criteria.
aTaskTypeThe task type of the tasks to be counted. If zero then the task type is not a selection criteria.
aResourceNameThe resource name ID (sensor/processor) of the task to be counted. If zero then resource name is not a selection criteria.
Returns
The number of tasks that have been assigned.

References WsfPlatform::GetIndex(), WsfPlatformPart::GetPlatform(), WsfTrackId::IsNull(), and mXmtdTaskList.

Referenced by ~WsfTaskManager().

◆ TasksReceivedFor()

int WsfTaskManager::TasksReceivedFor ( const WsfTrackId & aTrackId,
WsfStringId aTaskType,
WsfStringId aResourceName ) const

Return the count of the number of tasks that have received for the specified track.

Parameters
aTrackIdThe local track ID of the track of interest.
aTaskTypeThe task type of the tasks to be counted. If zero then the task type is not a selection criteria.
aResourceNameThe resource name ID (sensor/processor) of the task to be counted. If zero then resource name is not a selection criteria.
Returns
The number of tasks that have been received.

References WsfTrackId::IsNull(), and mRcvdTaskList.

Referenced by ~WsfTaskManager().

◆ TimeLastTaskAssigned()

double WsfTaskManager::TimeLastTaskAssigned ( ) const
inline

Get the time a task assignment was last made.

Returns
Time a task assignment was last made or < 0 if an assignment has never been made.

References mTimeLastTaskAssigned.

◆ TimeLastTaskReceived()

double WsfTaskManager::TimeLastTaskReceived ( ) const
inline

Get the time a task assignment was last received.

Returns
The time a task assignment was last received or < 0 if an assignment has never been received.

References mTimeLastTaskReceived.

◆ TimeTaskAssigned()

double WsfTaskManager::TimeTaskAssigned ( const WsfTrackId & aTrackId,
WsfStringId aTaskType,
size_t aAssigneeIndex ) const

Return the simulation time when a task was assigned.

References mXmtdTaskList.

Referenced by ~WsfTaskManager().

◆ TrackDropped()

void WsfTaskManager::TrackDropped ( double aSimTime,
const WsfTrackId & aTrackId )
protectedvirtual

◆ TurnOff()

void WsfTaskManager::TurnOff ( double aSimTime)
overridevirtual

Turn the processor off. The processor will no longer be called for received messages or periodic updates until it is turned on again.

Parameters
aSimTimeThe current simulation time.
Note
This method should not be invoked directly by application code. Use the WsfSimulation::TurnProcessorOff method.

Reimplemented from WsfProcessor.

Reimplemented in WsfTaskProcessor.

References mThinkerPtr, and WsfProcessor::TurnOff().

Referenced by WsfTaskProcessor::TurnOff(), and ~WsfTaskManager().

◆ TurnOn()

void WsfTaskManager::TurnOn ( double aSimTime)
overridevirtual

Turn the processor on. The processor will now be called for received messages and periodic updates.

Parameters
aSimTimeThe current simulation time.
Note
This method should not be invoked directly by application code. Use the WsfSimulation::TurnProcessorOn method.

Reimplemented from WsfProcessor.

Reimplemented in WsfTaskProcessor.

References mThinkerPtr, and WsfProcessor::TurnOn().

Referenced by WsfTaskProcessor::TurnOn(), and ~WsfTaskManager().

◆ Update()

void WsfTaskManager::Update ( double aSimTime)
overridevirtual

Update the state of the processor. This method should perform any actions that are necessary so that the system reflects its condition at the supplied time.

Parameters
aSimTimeThe current simulation time.

Reimplemented from WsfScriptProcessor.

References WsfProcessor::GetComponents(), and WsfScriptProcessor::Update().

Member Data Documentation

◆ mActiveTrackList

◆ mCallbacks

UtCallbackHolder WsfTaskManager::mCallbacks
protected

◆ mCommRetryAttempts

int WsfTaskManager::mCommRetryAttempts
protected

The number of attempts to retry failed communications.

Referenced by ProcessInput(), SendTaskMessage(), WsfTaskManager(), and WsfTaskManager().

◆ mCommRetryInterval

double WsfTaskManager::mCommRetryInterval
protected

The amount of time between attempts to retry failed communications.

Referenced by CheckMessageAcknowledged(), ProcessInput(), SendTaskMessage(), WsfTaskManager(), and WsfTaskManager().

◆ mNextTaskId

unsigned int WsfTaskManager::mNextTaskId
protected

◆ mOperatingLevels

std::map<WsfStringId, int> WsfTaskManager::mOperatingLevels
protected

The operating level by condition name. These are assigned in the input file (or by default). The may be updated by ChangeOperatingLevel. The key is the string ID of some operating condition or state name. The value is the level of the operating condition or state.

Referenced by OperatingLevelFor(), ProcessInput(), ProcessTaskControlMessage(), WsfTaskManager(), and WsfTaskManager().

◆ mPendingMessageList

◆ mPendingRcvdTasks

std::set<WsfTrackId> WsfTaskManager::mPendingRcvdTasks
protected

The set of assigned track ID's that are awaiting correlation with local track ID's.

Referenced by ProcessTaskAssignMessage(), WsfQuantumTaskerProcessor::PurgeReceivedTask(), WsfQuantumTaskerProcessor::UpdateTaskCorrelation(), WsfTaskManager(), and WsfTaskManager().

◆ mPurgedRcvdTaskList

TaskList WsfTaskManager::mPurgedRcvdTaskList
protected

A list of received tasks that have been reported as completed. An entry remains in this list until one of the following:

  • We receive acknowledgment of the task completion we sent.
  • We receive a task cancel message that may have been sent by the assigner before it received the task completion message the assignee sent.

Referenced by ProcessTaskCancelMessage(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfQuantumTaskerProcessor::RejectTask(), ReportTaskComplete(), WsfTaskManager(), and WsfTaskManager().

◆ mPurgedXmtdTaskList

TaskList WsfTaskManager::mPurgedXmtdTaskList
protected

A list of transmitted tasks that have recently been canceled. An entry remains in this list until one of the following:

  • We receive a task completion message for the same task. This generally occurs if the assignee sends a task completion message before they receive the task cancel message from the assigner.
  • We receive acknowledgment of a task cancel message we sent.

Referenced by CancelTask(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfTaskManager(), and WsfTaskManager().

◆ mRcvdTaskList

◆ mScenarioPtr

◆ mSensorRequestList

SensorRequestList WsfTaskManager::mSensorRequestList
protected

Referenced by WsfTaskManager(), and WsfTaskManager().

◆ mSensorsTurnedOn

std::set<WsfSensor*> WsfTaskManager::mSensorsTurnedOn
protected

The sensors that have been implicitly turned on.

Referenced by AcquireResource(), ReleaseResource(), WsfTaskManager(), and WsfTaskManager().

◆ mShowTaskMessages

◆ mShowUncompletedTasks

bool WsfTaskManager::mShowUncompletedTasks
protected

True if leak termination data is to be shown.

Referenced by Initialize2(), ProcessInput(), WsfQuantumTaskerProcessor::ReportTaskComplete(), and WsfTaskManager().

◆ mThinkerPtr

std::unique_ptr<WsfTimeDelayQueue> WsfTaskManager::mThinkerPtr
protected

◆ mTimeLastTaskAssigned

double WsfTaskManager::mTimeLastTaskAssigned
protected

◆ mTimeLastTaskReceived

double WsfTaskManager::mTimeLastTaskReceived
protected

◆ mTimeToRecognizeMessage

WsfRandomVariable WsfTaskManager::mTimeToRecognizeMessage
protected

The amount of time it takes to recognize a message.

Referenced by ProcessInput(), ReceiveMessage(), WsfTaskManager(), and WsfTaskManager().

◆ mTrackManagerPtr

◆ mTrackProcessorName

WsfStringId WsfTaskManager::mTrackProcessorName
protected

The name of the track processor whose track manager is the source of tracks.

Referenced by Initialize2(), ProcessInput(), WsfTaskManager(), and WsfTaskManager().

◆ mTrackUpdateInterval

double WsfTaskManager::mTrackUpdateInterval
protected

The time interval for sending track updates to assignees. If zero then track updates are not sent.

Referenced by ProcessInput(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), SendTrackUpdate(), WsfTaskManager(), and WsfTaskManager().

◆ mTrackUpdateStrategy

◆ mXmtdTaskList

◆ OnTaskAssigned

UtCallbackListN<void(double, WsfTask&, const WsfTrack&)> WsfTaskManager::OnTaskAssigned

Executes when an assigned task is accepted (by this processor).

Referenced by WsfQuantumTaskerProcessor::ProcessTaskAssignMessage(), ProcessTaskAssignMessage(), WsfTaskManager(), and WsfTaskManager().

◆ OnTaskAssignSent

UtCallbackListN<void(double, WsfTask&, const WsfTrack&)> WsfTaskManager::OnTaskAssignSent

Executes when a task assignment is sent.

Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), WsfTaskManager(), and WsfTaskManager().

◆ OnTaskCanceled

UtCallbackListN<void(double, WsfTask&)> WsfTaskManager::OnTaskCanceled

Executes when a task cancel message is processed.

Referenced by ProcessTaskCancelMessage(), WsfTaskManager(), and WsfTaskManager().

◆ OnTaskCancelSent

UtCallbackListN<void(double, WsfTask&)> WsfTaskManager::OnTaskCancelSent

Executes when a task cancel is sent.

Referenced by CancelTask(), WsfTaskManager(), and WsfTaskManager().

◆ OnTaskCompleted

UtCallbackListN<void(double, WsfTask&)> WsfTaskManager::OnTaskCompleted

◆ OnTaskCompleteSent

UtCallbackListN<void(double, WsfTask&, WsfStringId)> WsfTaskManager::OnTaskCompleteSent

Executes when a task complete is sent.

Referenced by ReportTaskComplete(), WsfTaskManager(), and WsfTaskManager().


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