|
WSF
|
#include <WsfTaskManager.hpp>


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< WsfStringId > | TypeList |
| 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. | |
| WsfTaskManager & | operator= (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) |
| WsfScriptMessageHandler * | GetMessageHandler () |
| WsfScriptContext & | GetScriptContext () |
| UtScriptContext * | GetScriptAccessibleContext () const override |
| void | SetPlatform (WsfPlatform *aPlatformPtr) override |
| const WsfBehaviorTree * | BehaviorTree () const |
| WsfAdvancedBehaviorTree * | AdvancedBehaviorTree () const |
| virtual const WsfScriptStateMachine * | GetStateMachine () const |
| wsf::ExternalLinks & | GetExternalLinks () |
| 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 | |
| ComponentList & | GetComponents () |
| const ComponentList & | GetComponents () const |
| virtual void | ProcessCallback (double aSimTime, const WsfCallback &aCallback) |
| WsfComponent * | CloneComponent () 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) | |
| WsfPlatformPart & | operator= (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 |
| WsfSimulation * | GetSimulation () const |
| const WsfScenario & | GetScenario () const |
| WsfStringId | GetComponentName () const override |
| void | ComponentParentChanged (WsfPlatform *aPlatformPtr) override |
| WsfPlatform * | GetPlatform () 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 |
| WsfInternalLinks & | GetInternalLinks () |
| 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 WsfCategoryList & | GetCategories () 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 WsfGroupList & | GetGroups () 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 TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (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 | |
| WsfComponentT & | operator= (const WsfComponentT &) noexcept |
| ~WsfComponentT () override=default | |
| ParentType * | GetComponentParent () 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. | |
| WsfUniqueId & | operator= (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 | |
| WsfAuxDataEnabled & | operator= (const WsfAuxDataEnabled &aRhs) |
| WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default | |
| WsfAuxDataEnabled & | operator= (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 | |
| WsfAttributeContainer & | GetAuxData () |
| const WsfAttributeContainer & | GetAuxData () const noexcept |
| const WsfAttributeContainer & | GetAuxDataConst () 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 | |
| WsfTrackManager * | mTrackManagerPtr |
| The track manager that owns the tracks. | |
| std::unique_ptr< WsfTimeDelayQueue > | mThinkerPtr |
| 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. | |
| WsfScenario * | mScenarioPtr |
| UtCallbackHolder | mCallbacks |
| TaskList | mXmtdTaskList |
| Tasks I have sent to others. | |
| TaskList | mPurgedXmtdTaskList |
| TaskList | mRcvdTaskList |
| Tasks I have received from others. | |
| TaskList | mPurgedRcvdTaskList |
| std::set< WsfTrackId > | mPendingRcvdTasks |
| 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 | |
| WsfProcessor * | Clone () 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. | |
| TaskList & | AssignedTaskList () |
| Return the list of tasks this TaskManager has assigned. | |
| TaskList & | ReceivedTaskList () |
| 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 TrackList & | ActiveTrackList () 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()). | |
| WsfProcessor & | operator= (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 | |
| WsfScriptContext * | mContextPtr |
| Pointer to the script context. | |
| WsfScriptMessageHandler * | mMessageHandlerPtr |
| Pointer to the 'on_message' handler. | |
| UtScript * | mOnMessageCreateScriptPtr |
| Pointer to the 'on_message_create' script. | |
| UtScriptClass * | mMessageClassPtr |
| wsf::ExternalLinks | mExternalLinks |
| The external recipients. | |
| WsfBehaviorTree * | mBehaviorTreePtr |
| ut::CloneablePtr< WsfAdvancedBehaviorTree > | mAdvancedBehaviorTreePtr |
| std::unique_ptr< WsfScriptStateMachine > | mStateMachinePtr |
| int | mStateIndex |
| bool | mSuppressMessage |
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.
| using WsfTaskManager::PendingMessageList = std::list<PendingMessage> |
typedef to simplify iteration for calling WsfTaskManagerComponent methods.
| using WsfTaskManager::SensorRequestList = std::list<SensorRequest> |
| using WsfTaskManager::TaskList = std::list<WsfTask> |
| using WsfTaskManager::TrackList = std::list<ActiveTrack> |
| using WsfTaskManager::TrackListIter = std::list<ActiveTrack>::iterator |
| WsfTaskManager::WsfTaskManager | ( | WsfScenario & | aScenario, |
| const std::string & | aClassName = "WsfTaskManager" ) |
Constructor.
References cDEFAULT, mActiveTrackList, mCallbacks, mCommRetryAttempts, mCommRetryInterval, WsfScriptProcessor::mContextPtr, mNextTaskId, mOperatingLevels, mPendingMessageList, mPendingRcvdTasks, mPurgedRcvdTaskList, mPurgedXmtdTaskList, mRcvdTaskList, mScenarioPtr, mSensorRequestList, mSensorsTurnedOn, mShowTaskMessages, mShowUncompletedTasks, mThinkerPtr, mTimeLastTaskAssigned, mTimeLastTaskReceived, mTimeToRecognizeMessage, mTrackManagerPtr, mTrackProcessorName, mTrackUpdateInterval, mTrackUpdateStrategy, mXmtdTaskList, OnTaskAssigned, OnTaskAssignSent, OnTaskCanceled, OnTaskCancelSent, OnTaskCompleted, OnTaskCompleteSent, and WsfScriptProcessor::WsfScriptProcessor().
Referenced by Clone(), WsfTaskManager::EventBase::EventBase(), WsfTaskManager::EventBase::ExecuteEvent(), WsfTaskManager::TaskCompleteEvent::ExecuteEvent(), WsfTaskManager::TrackUpdateEvent::ExecuteEvent(), operator=(), WsfTaskManager::PendingMessage::PendingMessage(), WsfTaskManager::TaskCompleteEvent::TaskCompleteEvent(), WsfTaskManager::TrackUpdateEvent::TrackUpdateEvent(), WsfQuantumTaskerProcessor::WsfQuantumTaskerProcessor(), WsfQuantumTaskerProcessor::WsfQuantumTaskerProcessor(), WsfQuantumTaskerProcessor::WsfQuantumTaskerProcessor(), WsfTaskManager(), WsfTaskProcessor::WsfTaskProcessor(), and WsfTaskProcessor::WsfTaskProcessor().
|
overridedefault |
References AssigneeForTask(), AssigneesForTask(), AssignTask(), CancelTask(), ChangeOperatingLevel(), Clone(), CreateDelayTask(), GetComponentRoles(), GetScriptClassName(), Initialize(), Initialize2(), OperatingLevelFor(), PlatformDeleted(), PreInitialize(), ProcessInput(), ProcessMessage(), QueryInterface(), ReceiveMessage(), ReportTaskComplete(), ReportTaskProgress(), TasksAssignedFor(), TasksAssignedTo(), TasksReceivedFor(), TimeTaskAssigned(), TurnOff(), TurnOn(), and WsfProcessor::WsfProcessor().
|
protected |
Copy constructor.
References mActiveTrackList, mCallbacks, mCommRetryAttempts, mCommRetryInterval, mOperatingLevels, mPendingMessageList, mPendingRcvdTasks, mPurgedRcvdTaskList, mPurgedXmtdTaskList, mRcvdTaskList, mScenarioPtr, mSensorRequestList, mSensorsTurnedOn, mThinkerPtr, mTimeToRecognizeMessage, mTrackManagerPtr, mTrackProcessorName, mTrackUpdateInterval, mXmtdTaskList, OnTaskAssigned, OnTaskAssignSent, OnTaskCanceled, OnTaskCancelSent, OnTaskCompleted, OnTaskCompleteSent, WsfScriptProcessor::WsfScriptProcessor(), and WsfTaskManager().
|
protectedvirtual |
Reimplemented in WsfQuantumTaskerProcessor.
References WsfProcessor::GetComponents(), WsfSensor::GetMaximumRequestCount(), WsfSensor::GetModeCount(), WsfSensor::GetModeIndex(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTask::GetResourceMode(), WsfTask::GetResourceName(), WsfPlatformPart::GetSimulation(), WsfTrack::GetTrackId(), WsfPlatformPart::IsTurnedOn(), mSensorsTurnedOn, ok, WsfSensor::StartTracking(), and WsfSimulation::TurnPartOn().
Referenced by ProcessTaskAssignMessage().
|
inline |
Return the list of tasks this TaskManager has active.
References mActiveTrackList.
|
inline |
Return the list of tasks this TaskManager has assigned.
References mXmtdTaskList.
Referenced by WsfXIO_TaskService::SendInitial().
| size_t WsfTaskManager::AssigneeForTask | ( | const WsfTrackId & | aTrackId, |
| WsfStringId | aTaskType, | ||
| WsfStringId | aResourceName ) const |
Return the platform (index) of the assignee for the specified task.
| aTrackId | The local track ID of the task of interest. |
| aTaskType | The task type of the task of interest. |
| aResourceName | The name (ID) of the resource of interest. |
References mXmtdTaskList.
Referenced by ~WsfTaskManager().
| 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.
| aTrackId | The local track ID of the track of interest. If null then the track ID is not a selection criteria. |
| aTaskType | The task type of the tasks to be counted. If zero then the task type is not a selection criteria. |
| aAssignees | The indexes of the platforms that have been assigned to the specified task. |
References WsfTrackId::IsNull(), and mXmtdTaskList.
Referenced by ~WsfTaskManager().
|
virtual |
Assign a task.
| aSimTime | The current simulation time. |
| aTrack | The track that represents the objective of the assignment. |
| aTask | The task to be assigned. |
| aLockTrack | 'true' if the track should be locked to prevent deletion. |
Reimplemented in WsfQuantumTaskerProcessor.
References cTASK_RESOURCE_TYPE_PROCESSOR, FindTask(), WsfTask::GetAssigneePlatformIndex(), WsfTask::GetCommName(), WsfComponentList::GetComponent(), WsfProcessor::GetComponents(), WsfPlatform::GetIndex(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfTask::GetResource(), WsfTask::GetResourceName(), WsfPlatformPart::GetSimulation(), WsfTrack::GetTargetName(), WsfTask::GetTaskType(), WsfTrack::GetTrackId(), WsfTaskResource::GetType(), WsfTaskResource::GetTypeName(), WsfTask::Initialize(), WsfTrackId::IsNull(), WsfTaskResource::mNameId, mNextTaskId, mShowTaskMessages, mTimeLastTaskAssigned, mTrackManagerPtr, mXmtdTaskList, ok, OnTaskAssignSent, SelectCommDevice(), SendTaskMessage(), WsfTask::SetAssigneeProcessorName(), WsfTask::SetCommName(), WsfTask::SetLocalTrackId(), WsfTask::SetTargetName(), WsfTaskAssignMessage::SetTask(), WsfTaskAssignMessage::SetTrack(), WsfTask::SetTrackId(), WsfObserver::TaskAssigned(), TaskAssignSent(), and WsfProcessor::WsfProcessor().
Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), CreateDelayTask(), WsfXIO_TaskService::HandleCommand(), and ~WsfTaskManager().
|
virtual |
Assign a task.
| aSimTime | The current simulation time. |
| aTrack | The track that represents the objective of the assignment. |
| aTaskType | The 'type' of the task. |
| aResource | The resource specification of the resource to be allocated. |
| aAssigneePtr | A pointer to the platform to be assigned to the task. |
| aCommName | The 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().
|
virtual |
Cancel tasks and subtasks.
| aSimTime | The current simulation time. |
| aTrackId | The track ID of the task(s) to be canceled. |
| aTaskType | The task type of the tasks to be canceled. If zero then the task type is not a selection criteria. |
| aResource | The associated resource of the task to be canceled. If a resource name is not specified it is not a selection criteria. |
| aAssigneeIndex | The 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.
|
virtual |
Cancel tasks and subtasks.
| aSimTime | The current simulation time. |
| aTaskId | The task ID of the task to be canceled. |
References CancelTask(), FindTask(), and mXmtdTaskList.
Referenced by CancelTask(), CancelTask(), CheckMessageAcknowledged(), WsfXIO_TaskService::HandleCommand(), PlatformDeleted(), WsfQuantumTaskerProcessor::PurgeReceivedTask(), WsfRF_Repeater::SensorTrackDropped(), WsfQuantumTaskerProcessor::Update(), and ~WsfTaskManager().
|
virtual |
An internal routine to cancel a task that we have assigned. This routine sends the cancel message for the indicated task.
| aSimTime | The current simulation time. |
| aTask | The 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().
|
virtual |
Change the operating level for a given subordinate.
References WsfPlatform::GetIndex(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), mShowTaskMessages, SelectCommDevice(), SendTaskMessage(), WsfTaskControlMessage::SetLevel(), and WsfTaskControlMessage::SetName().
Referenced by WsfXIO_TaskService::HandleCommand(), and ~WsfTaskManager().
| void WsfTaskManager::CheckMessageAcknowledged | ( | double | aSimTime, |
| unsigned int | aSerialNumber ) |
Internal method to check if an acknowledgment has been received for a message requiring reliable service. This method is invoked by CheckMessageEvent.
References WsfSimulation::AddEvent(), CancelTask(), FindTask(), WsfTask::GetAssigneePlatformIndex(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformNameId(), WsfTask::GetResourceName(), WsfPlatformPart::GetSimulation(), WsfTaskAssignMessage::GetTask(), WsfTask::GetTaskType(), WsfTask::GetTrackId(), WsfMessage::GetType(), WsfTaskAssignMessage::GetTypeId(), WsfTaskManager::PendingMessage::mCommName, mCommRetryInterval, WsfTaskManager::PendingMessage::mMessagePtr, mPendingMessageList, WsfTaskManager::PendingMessage::mRecipientIndex, WsfTaskManager::PendingMessage::mRetryAttempts, WsfTaskManager::PendingMessage::mSuppressTimeoutMessage, WsfTaskManager::PendingMessage::mTimeSent, mXmtdTaskList, and SendTaskMessage().
|
overridevirtual |
A virtual copy constructor.
Reimplemented from WsfScriptProcessor.
Reimplemented in WsfTaskProcessor.
References WsfProcessor::WsfProcessor(), and WsfTaskManager().
Referenced by WsfTaskManager::PendingMessage::PendingMessage(), WsfTaskManager::PendingMessage::PendingMessage(), and ~WsfTaskManager().
|
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.
| aSimTime | The current simulation time. |
| aDelayTime | The amount of time to delay. |
| aTrack | The 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. |
| aTaskType | The 'type' of the task. |
References WsfSimulation::AddEvent(), AssignTask(), FindTask(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetSimulation(), WsfTrack::GetTrackId(), mRcvdTaskList, and mXmtdTaskList.
Referenced by ~WsfTaskManager().
|
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.
| aPurgedTaskList | Either the transmitted or received purged task list. |
| aAssignerIndex | The platform index of the task assigner. |
| aTaskId | The assigners task ID. |
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().
|
static |
Find a task with the specified task ID, assignee name and resource Id.
| aTaskList | The task list to be searched. |
| aAssigneeIndex | The platform index of the assignee to the task. |
| aTrackId | The task ID of the task to be located. |
| aTaskType | The type of the task to be located. |
| aResourceName | The resource ID of the task to be located. |
Referenced by AssignTask(), WsfWeaponTaskManager::AssignTask(), CancelTask(), CheckMessageAcknowledged(), CreateDelayTask(), ProcessTaskAssignMessage(), ProcessTaskCancelMessage(), ProcessTaskStatusMessage(), ReportTaskComplete(), ReportTaskProgress(), WsfWeaponTaskManager::StartingWeaponTask(), and WsfWeaponTaskManager::UplinkStart().
|
static |
Find a task with the specified task ID
| aTaskList | The task list to be searched. |
| aTaskId | The task ID of the task to be located. |
|
static |
|
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:
Reimplemented from WsfProcessor.
References cWSF_COMPONENT_NULL, cWSF_COMPONENT_PLATFORM_PART, cWSF_COMPONENT_PROCESSOR, and cWSF_COMPONENT_TASK_MANAGER.
Referenced by ~WsfTaskManager().
|
protected |
Given a message, get the platform index of the sender and the local device on which the message was received.
References WsfComponentList::RoleIterator< T >::AtEnd(), wsf::comm::Address::GetAddress(), WsfMessage::GetDstAddr(), WsfPlatform::GetIndex(), WsfObject::GetName(), WsfMessage::GetOriginator(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformByName(), and WsfPlatformPart::GetSimulation().
Referenced by WsfQuantumTaskerProcessor::ProcessTaskAssignMessage(), and ProcessTaskAssignMessage().
|
override |
Referenced by ~WsfTaskManager().
|
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.
| aSimTime | The current simulation time. |
Reimplemented from WsfScriptProcessor.
Reimplemented in WsfTaskProcessor.
References WsfPlatformPart::GetPlatform(), WsfScriptProcessor::GetScriptContext(), WsfScriptProcessor::Initialize(), mThinkerPtr, and ok.
Referenced by WsfQuantumTaskerProcessor::Initialize(), WsfTaskProcessor::Initialize(), and ~WsfTaskManager().
|
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.
| aSimTime | The current simulation time. |
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().
|
protected |
The acknowledgment for the specified message has been received.
| aSerialNumber | The serial number of the message that has been acknowledged. |
References WsfMessage::GetSerialNumber(), WsfTaskManager::PendingMessage::mMessagePtr, and mPendingMessageList.
Referenced by WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), and ProcessTaskStatusMessage().
|
protectedvirtual |
References WsfPlatformPart::IsExternallyControlled(), and WsfScriptProcessor::mContextPtr.
Referenced by ProcessTaskControlMessage().
| 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().
|
delete |
References WsfTaskManager().
|
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.
| aPlatformPtr | Pointer 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().
|
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.
| aSimTime | The current simulation time. |
Reimplemented from WsfProcessor.
References ok, and WsfProcessor::PreInitialize().
Referenced by WsfQuantumTaskerProcessor::PreInitialize(), and ~WsfTaskManager().
|
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.
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().
|
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'.
| aInput | a reference to a UtInput object. |
| UtInput::ExceptionBase | (or an object derived from it) if the command was recognized but contains some sort of error. |
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().
|
overridevirtual |
Process a received message.
| aSimTime | The current simulation time. |
| aMessage | The message that is being sent. |
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().
|
protectedvirtual |
Reimplemented in WsfQuantumTaskerProcessor.
References AcquireResource(), FindTask(), WsfTask::GetAssignerPlatformIndex(), WsfTask::GetAssignerProcessorName(), WsfTask::GetLocalTrackId(), GetMessageSender(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTask::GetResource(), WsfTask::GetResourceName(), WsfMessage::GetSerialNumber(), WsfPlatformPart::GetSimulation(), WsfTask::GetTargetName(), WsfTaskAssignMessage::GetTask(), WsfTask::GetTaskType(), WsfTaskAssignMessage::GetTrack(), WsfTask::GetTrackId(), WsfTrack::GetTrackId(), WsfTaskResource::GetTypeName(), WsfTrackId::IsNull(), mPendingRcvdTasks, mRcvdTaskList, mScenarioPtr, mShowTaskMessages, mTimeLastTaskReceived, mTrackManagerPtr, OnTaskAssigned, SendTaskMessage(), WsfTaskStatusMessage::SetAcknowledgeId(), WsfTask::SetCommName(), WsfTask::SetLocalTrackId(), WsfObserver::TaskAccepted(), TaskAssigned(), WsfObserver::TaskCompleted(), and TaskCorrelated().
Referenced by ProcessMessage(), and WsfQuantumTaskerProcessor::ProcessTaskAssignMessage().
|
protectedvirtual |
References DropFromPurgedTaskList(), FindTask(), WsfTask::GetAssignerPlatformIndex(), WsfTaskCancelMessage::GetAssignerPlatformIndex(), WsfTask::GetCommName(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTaskCancelMessage::GetResourceName(), WsfMessage::GetSerialNumber(), WsfTaskCancelMessage::GetTaskId(), WsfTaskCancelMessage::GetTaskType(), WsfTaskCancelMessage::GetTrackId(), mPurgedRcvdTaskList, mRcvdTaskList, mScenarioPtr, mShowTaskMessages, OnTaskCanceled, SendTaskMessage(), WsfTaskStatusMessage::SetAcknowledgeId(), and TaskCanceled().
Referenced by ProcessMessage().
|
protectedvirtual |
References WsfTaskControlMessage::GetLevel(), WsfObject::GetName(), WsfTaskControlMessage::GetName(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetSimulation(), mOperatingLevels, mShowTaskMessages, WsfObserver::OperatingLevelChanged(), and OperatingLevelChanged().
Referenced by ProcessMessage().
|
protectedvirtual |
Reimplemented in WsfQuantumTaskerProcessor.
References WsfSimulation::AddEvent(), cDEFAULT, DropFromPurgedTaskList(), FindTask(), WsfTaskStatusMessage::GetAcknowledgeId(), WsfTask::GetAssigneePlatformIndex(), WsfTaskStatusMessage::GetAssigneePlatformIndex(), WsfTaskStatusMessage::GetAssigneePlatformName(), WsfTaskStatusMessage::GetAssignerPlatformIndex(), WsfTask::GetCommName(), WsfProcessor::GetComponents(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTaskStatusMessage::GetResourceName(), WsfMessage::GetSerialNumber(), WsfPlatformPart::GetSimulation(), WsfTaskStatusMessage::GetStatus(), WsfTaskStatusMessage::GetSubStatus(), WsfTask::GetTaskId(), WsfTaskStatusMessage::GetTaskId(), WsfTaskStatusMessage::GetTaskType(), WsfTaskStatusMessage::GetTrackId(), MessageAcknowledged(), mPurgedRcvdTaskList, mPurgedXmtdTaskList, mScenarioPtr, mShowTaskMessages, mTrackUpdateInterval, mTrackUpdateStrategy, mXmtdTaskList, OnTaskCompleted, SendTaskMessage(), WsfTaskStatusMessage::SetAcknowledgeId(), WsfTaskStatusMessage::SetIsFromAssignee(), WsfTask::SetStatus(), WsfTask::SetSubStatus(), WsfTask::SetUpdateTime(), and TaskCompleted().
Referenced by ProcessMessage().
|
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().
|
protectedvirtual |
Referenced by ProcessMessage().
|
overridevirtual |
Requests a component's role interface. A component can support one or more roles.
| aRole | The role whose interface is to be returned. |
Reimplemented from WsfProcessor.
References cWSF_COMPONENT_TASK_MANAGER, and WsfProcessor::QueryInterface().
Referenced by ~WsfTaskManager().
|
inline |
Return the list of tasks this TaskManager has received.
References mRcvdTaskList.
Referenced by WsfXIO_TaskService::SendInitial().
|
overridevirtual |
Receive a message from another platform part (system). The default implementation simply calls ProcessMessage to process the received message.
| aSimTime | The current simulation time. |
| aMessage | The message that is being sent. |
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().
|
protectedvirtual |
Reimplemented in WsfQuantumTaskerProcessor.
References cTASK_RESOURCE_TYPE_SENSOR, WsfSensor::GetActiveRequestCount(), WsfProcessor::GetComponents(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfTask::GetResourceName(), WsfPlatformPart::GetSimulation(), WsfTask::GetTaskId(), WsfTask::GetTrackId(), WsfSensor::HaveRequestFor(), WsfTrackId::IsNull(), mRcvdTaskList, mSensorsTurnedOn, ok, WsfSensor::StopTracking(), and WsfSimulation::TurnPartOff().
|
virtual |
Reimplemented in WsfQuantumTaskerProcessor.
References FindTask(), WsfTask::GetAssignerPlatformIndex(), WsfTask::GetCommName(), WsfObject::GetName(), WsfObject::GetNameId(), WsfPlatformPart::GetPlatform(), WsfTask::GetResource(), WsfTask::GetResourceName(), WsfPlatformPart::GetSimulation(), WsfTask::GetTargetName(), WsfTask::GetTaskType(), WsfTask::GetTrackId(), WsfTaskResource::GetTypeName(), WsfPlatformPart::IsExternallyControlled(), WsfScriptProcessor::mContextPtr, mPurgedRcvdTaskList, mRcvdTaskList, mScenarioPtr, mShowTaskMessages, ok, OnTaskCompleteSent, SendTaskMessage(), WsfTaskStatusMessage::SetSubStatus(), and WsfObserver::TaskCompleted().
Referenced by WsfTaskManager::TaskCompleteEvent::ExecuteEvent(), WsfXIO_TaskService::HandleCommand(), ProcessTrackDropMessage(), WsfQuantumTaskerProcessor::ReportTaskComplete(), and ~WsfTaskManager().
|
virtual |
Reimplemented in WsfQuantumTaskerProcessor.
References FindTask(), WsfTask::GetAssignerPlatformIndex(), WsfTask::GetCommName(), WsfObject::GetName(), WsfObject::GetNameId(), WsfPlatformPart::GetPlatform(), WsfTask::GetResource(), WsfTask::GetResourceName(), WsfTask::GetTargetName(), WsfTask::GetTaskType(), WsfTask::GetTrackId(), WsfTaskResource::GetTypeName(), mRcvdTaskList, mScenarioPtr, mShowTaskMessages, ok, SendTaskMessage(), and WsfTaskStatusMessage::SetSubStatus().
Referenced by WsfXIO_TaskService::HandleCommand(), WsfQuantumTaskerProcessor::ReportTaskProgress(), and ~WsfTaskManager().
| 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.
| aRecipientPtr | The intended recipient. |
| aCommName | The supplied comm device (or zero if to be determined). |
References WsfPlatformPart::GetPlatform(), and wsf::comm::util::SelectDevice().
Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), ChangeOperatingLevel(), and WsfQuantumTaskerProcessor::RejectTask().
| 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.
| aSimTime | The current simulation time. |
| aMessage | The message to be sent. |
| aRecipientIndex | The platform index of the recipient. |
| aCommName | For 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. |
| aReliable | If 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().
| 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.
| aSimTime | The current simulation time. |
| aTaskId | The unique identifier for the task. |
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().
|
inline |
References mShowTaskMessages.
|
protectedvirtual |
References WsfPlatformPart::IsExternallyControlled(), and WsfScriptProcessor::mContextPtr.
Referenced by WsfQuantumTaskerProcessor::ProcessTaskAssignMessage(), and ProcessTaskAssignMessage().
|
protectedvirtual |
References WsfPlatformPart::IsExternallyControlled(), and WsfScriptProcessor::mContextPtr.
Referenced by WsfQuantumTaskerProcessor::AssignTask(), and AssignTask().
|
protectedvirtual |
References WsfProcessor::GetComponents(), WsfPlatformPart::IsExternallyControlled(), and WsfScriptProcessor::mContextPtr.
Referenced by ProcessTaskCancelMessage().
|
protectedvirtual |
Reimplemented in WsfQuantumTaskerProcessor, and WsfTaskProcessor.
References WsfProcessor::GetComponents(), WsfPlatformPart::IsExternallyControlled(), and WsfScriptProcessor::mContextPtr.
Referenced by ProcessTaskStatusMessage(), WsfQuantumTaskerProcessor::TaskCompleted(), and WsfTaskProcessor::TaskCompleted().
|
protectedvirtual |
Called when a task has been correlated with a local track.
References WsfProcessor::GetComponents().
Referenced by ProcessTaskAssignMessage(), and WsfQuantumTaskerProcessor::UpdateTaskCorrelation().
| 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.
| aTrackId | The local track ID of the track of interest. |
| aTaskType | The task type of the tasks to be counted. If zero then the task type is not a selection criteria. |
| aResourceName | The resource name ID (sensor/processor) of the task to be counted. If zero then resource name is not a selection criteria. |
References WsfTrackId::IsNull(), and mXmtdTaskList.
Referenced by WsfRF_Repeater::SensorTrackDropped(), and ~WsfTaskManager().
| 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.
| aAssigneeIndex | The platform index of the assigned platform to be queried. |
| aTrackId | The local track ID of the track of interest. If null then the track ID is not a selection criteria. |
| aTaskType | The task type of the tasks to be counted. If zero then the task type is not a selection criteria. |
| aResourceName | The resource name ID (sensor/processor) of the task to be counted. If zero then resource name is not a selection criteria. |
References WsfPlatform::GetIndex(), WsfPlatformPart::GetPlatform(), WsfTrackId::IsNull(), and mXmtdTaskList.
Referenced by ~WsfTaskManager().
| 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.
| aTrackId | The local track ID of the track of interest. |
| aTaskType | The task type of the tasks to be counted. If zero then the task type is not a selection criteria. |
| aResourceName | The resource name ID (sensor/processor) of the task to be counted. If zero then resource name is not a selection criteria. |
References WsfTrackId::IsNull(), and mRcvdTaskList.
Referenced by ~WsfTaskManager().
|
inline |
Get the time a task assignment was last made.
References mTimeLastTaskAssigned.
|
inline |
Get the time a task assignment was last received.
References mTimeLastTaskReceived.
| 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().
|
protectedvirtual |
References WsfProcessor::GetComponents().
|
overridevirtual |
Turn the processor off. The processor will no longer be called for received messages or periodic updates until it is turned on again.
| aSimTime | The current simulation time. |
Reimplemented from WsfProcessor.
Reimplemented in WsfTaskProcessor.
References mThinkerPtr, and WsfProcessor::TurnOff().
Referenced by WsfTaskProcessor::TurnOff(), and ~WsfTaskManager().
|
overridevirtual |
Turn the processor on. The processor will now be called for received messages and periodic updates.
| aSimTime | The current simulation time. |
Reimplemented from WsfProcessor.
Reimplemented in WsfTaskProcessor.
References mThinkerPtr, and WsfProcessor::TurnOn().
Referenced by WsfTaskProcessor::TurnOn(), and ~WsfTaskManager().
|
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.
| aSimTime | The current simulation time. |
Reimplemented from WsfScriptProcessor.
References WsfProcessor::GetComponents(), and WsfScriptProcessor::Update().
|
protected |
Referenced by ActiveTrackList(), ProcessAssociationMessage(), ProcessTrackDropMessage(), WsfTaskManager(), and WsfTaskManager().
|
protected |
Referenced by Initialize2(), WsfTaskManager(), and WsfTaskManager().
|
protected |
The number of attempts to retry failed communications.
Referenced by ProcessInput(), SendTaskMessage(), WsfTaskManager(), and WsfTaskManager().
|
protected |
The amount of time between attempts to retry failed communications.
Referenced by CheckMessageAcknowledged(), ProcessInput(), SendTaskMessage(), WsfTaskManager(), and WsfTaskManager().
|
protected |
The next task ID to be assigned.
Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), WsfQuantumTaskerProcessor::ReportTaskComplete(), and WsfTaskManager().
|
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().
|
protected |
|
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().
|
protected |
A list of received tasks that have been reported as completed. An entry remains in this list until one of the following:
Referenced by ProcessTaskCancelMessage(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfQuantumTaskerProcessor::RejectTask(), ReportTaskComplete(), WsfTaskManager(), and WsfTaskManager().
|
protected |
A list of transmitted tasks that have recently been canceled. An entry remains in this list until one of the following:
Referenced by CancelTask(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfTaskManager(), and WsfTaskManager().
|
protected |
Tasks I have received from others.
Referenced by CreateDelayTask(), WsfQuantumTaskerProcessor::ProcessTaskAssignMessage(), ProcessTaskAssignMessage(), ProcessTaskCancelMessage(), ProcessTrackDropMessage(), ReceivedTaskList(), WsfQuantumTaskerProcessor::RejectTask(), ReleaseResource(), ReportTaskComplete(), ReportTaskProgress(), WsfQuantumTaskerProcessor::TaskListReceivedForResourceName(), WsfQuantumTaskerProcessor::TaskListReceivedForResourceType(), WsfQuantumTaskerProcessor::TaskListReceivedForTrack(), WsfQuantumTaskerProcessor::TaskListReceivedOfType(), WsfQuantumTaskerProcessor::TaskListReceivedOfTypeForTrack(), TasksReceivedFor(), WsfTaskManager(), and WsfTaskManager().
|
protected |
|
protected |
Referenced by WsfTaskManager(), and WsfTaskManager().
|
protected |
The sensors that have been implicitly turned on.
Referenced by AcquireResource(), ReleaseResource(), WsfTaskManager(), and WsfTaskManager().
|
protected |
True if task related messages are to be displayed.
Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), CancelTask(), ChangeOperatingLevel(), Initialize2(), ProcessAssociationMessage(), ProcessInput(), ProcessTaskAssignMessage(), ProcessTaskCancelMessage(), ProcessTaskControlMessage(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), ProcessTrackDropMessage(), WsfQuantumTaskerProcessor::PurgeReceivedTask(), WsfQuantumTaskerProcessor::RejectTask(), WsfQuantumTaskerProcessor::ReportTaskComplete(), ReportTaskComplete(), ReportTaskProgress(), ShowTaskMessages(), WsfQuantumTaskerProcessor::UpdateTaskCorrelation(), and WsfTaskManager().
|
protected |
True if leak termination data is to be shown.
Referenced by Initialize2(), ProcessInput(), WsfQuantumTaskerProcessor::ReportTaskComplete(), and WsfTaskManager().
|
protected |
The pointer to the 'thinker'.
Referenced by Initialize(), WsfTaskProcessor::Initialize2(), ProcessInput(), ReceiveMessage(), TurnOff(), TurnOn(), WsfTaskManager(), and WsfTaskManager().
|
protected |
The time a task was last sent.
Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), WsfQuantumTaskerProcessor::ReportTaskComplete(), TimeLastTaskAssigned(), and WsfTaskManager().
|
protected |
The time a task was last received.
Referenced by ProcessTaskAssignMessage(), WsfQuantumTaskerProcessor::ReportTaskComplete(), TimeLastTaskReceived(), and WsfTaskManager().
|
protected |
The amount of time it takes to recognize a message.
Referenced by ProcessInput(), ReceiveMessage(), WsfTaskManager(), and WsfTaskManager().
|
protected |
The track manager that owns the tracks.
Referenced by AssignTask(), Initialize2(), WsfTaskProcessor::Initialize2(), ProcessTaskAssignMessage(), SendTrackUpdate(), WsfQuantumTaskerProcessor::UpdateTaskCorrelation(), WsfTaskManager(), and WsfTaskManager().
|
protected |
The name of the track processor whose track manager is the source of tracks.
Referenced by Initialize2(), ProcessInput(), WsfTaskManager(), and WsfTaskManager().
|
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().
|
protected |
Determine how track updates are sent.
Referenced by ProcessInput(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfQuantumTaskerProcessor::ReportTaskComplete(), and WsfTaskManager().
|
protected |
Tasks I have sent to others.
Referenced by AssignedTaskList(), AssigneeForTask(), WsfQuantumTaskerProcessor::AssigneesForTask(), AssigneesForTask(), WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), CancelTask(), CancelTask(), CheckMessageAcknowledged(), CreateDelayTask(), PlatformDeleted(), WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfQuantumTaskerProcessor::PurgeReceivedTask(), SendTrackUpdate(), WsfQuantumTaskerProcessor::SetMatrixTasks(), WsfQuantumTaskerProcessor::TaskListAssignedForResourceName(), WsfQuantumTaskerProcessor::TaskListAssignedForResourceType(), WsfQuantumTaskerProcessor::TaskListAssignedForTrack(), WsfQuantumTaskerProcessor::TaskListAssignedOfType(), TasksAssignedFor(), TasksAssignedTo(), TimeTaskAssigned(), WsfQuantumTaskerProcessor::Update(), WsfTaskManager(), and WsfTaskManager().
Executes when an assigned task is accepted (by this processor).
Referenced by WsfQuantumTaskerProcessor::ProcessTaskAssignMessage(), ProcessTaskAssignMessage(), WsfTaskManager(), and WsfTaskManager().
Executes when a task assignment is sent.
Referenced by WsfQuantumTaskerProcessor::AssignTask(), AssignTask(), WsfTaskManager(), and WsfTaskManager().
| UtCallbackListN<void(double, WsfTask&)> WsfTaskManager::OnTaskCanceled |
Executes when a task cancel message is processed.
Referenced by ProcessTaskCancelMessage(), WsfTaskManager(), and WsfTaskManager().
| UtCallbackListN<void(double, WsfTask&)> WsfTaskManager::OnTaskCancelSent |
Executes when a task cancel is sent.
Referenced by CancelTask(), WsfTaskManager(), and WsfTaskManager().
| UtCallbackListN<void(double, WsfTask&)> WsfTaskManager::OnTaskCompleted |
Executes when an task complete is received.
Referenced by WsfQuantumTaskerProcessor::ProcessTaskStatusMessage(), ProcessTaskStatusMessage(), WsfTaskManager(), and WsfTaskManager().
| UtCallbackListN<void(double, WsfTask&, WsfStringId)> WsfTaskManager::OnTaskCompleteSent |
Executes when a task complete is sent.
Referenced by ReportTaskComplete(), WsfTaskManager(), and WsfTaskManager().