![]() |
VR-Forces 4.1.1 Class Documentation
|
Class DtDisaggregatedMoveAlongController is a task controller that models aggregate entity move-along-route behavior. More...

Public Member Functions | |
| DtDisaggregatedMoveAlongController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtDisaggregatedMoveAlongController () |
| destructor | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual bool | init () |
| Initialize myAggregateStateRepository, myFormationState, and myAggregateMoveAlongDescriptor member variables. | |
| virtual void | registerTaskMsgCallbacks () |
| Registers moveAlongTaskCallback member function for DtMoveAlongType tasks on radio (for tasks issued in GUI or by superior). | |
| virtual void | tick () |
| Calls registerRouteCallbacksIfNeeded() to register route-related callbacks so we can be notified in the event the route changes. | |
| virtual void | clearTask () |
| If tasked, clears out myProcessState, sends clear task messages to any subordinates that are currently tasked, and calls deleteFormationRoutes() to remove any working routes this controller has created. | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
| virtual DtSimTaskStatePtr | currentTaskState () const |
| Returns pointer to a DtMoveAlongTaskState object containing status of our current move-along task. | |
Public Member Functions inherited from DtSingleTaskControllerComponent | |
| DtSingleTaskControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString& name, | |
| virtual | ~DtSingleTaskControllerComponent () |
| destructor | |
| virtual void | postTick () |
| Override to check if we're tasked and we want to give up (only performs the check if we're in play mode (dT() > 0)). | |
| virtual bool | beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState) |
| Called by the task manager when this controller should start executing the specified task. | |
| virtual void | taskNotify (const DtSimTask &task) |
| This is called to let us know when some other component receives a task In the case of this component, we don't care what the task actually is. | |
| virtual void | taskComplete (bool success=true) |
| If we are currently tasked, this will cause us to notify the entity that we're done and delete the task. | |
| virtual int | sendSubtask (DtSimTask &task) |
| Sends subtask to ourself. | |
| virtual void | clearSubtask (int subtaskId) |
| Clears subtask with the given subtaskId (subtaskId is returned sendSubtask()). | |
| virtual void | addPendingSubtaskId (int subtaskId) |
| Adds given subtask Id to list of pending subtasks. | |
| virtual bool | findPendingSubtaskId (int subtaskId) |
| Checks to see if given subtaskId exists in our list of pending subtasks. | |
| virtual void | removePendingSubtaskId (int subtaskId) |
| Removes pending subtask from list of subtasks for this component. | |
| virtual void | removeAllPendingSubtaskIds () |
| Clear all pending subtasks from our list of subtasks. | |
| virtual std::vector< int > | currentPendingSubstaskIds () const |
| Returns the list of all currently pending subtask ids for this controller. | |
| virtual void | clearCurrentTaskMessage () |
| Returns the current subtask with the specified id. | |
| virtual DtTaskMessage * | currentTaskMessage () const |
| Get a pointer to the message that was used to task this entity. | |
| virtual bool | decideToGiveUpTask () const |
| This function is used to determine if the controller should give up trying to execute the current task. | |
| virtual void | giveUpTask () |
| Called when controller is tasked and decideToGiveUp() returns true. | |
| virtual bool | taskActive (int taskId) const |
| | |
| virtual bool | clearTopLevelTasks () |
| If this controller has any top level tasks (not subtasks), they are cleared. | |
| virtual void | clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType) |
| Clears any top level tasks on this controller that conflict with the conflict task type. | |
| virtual void | clearTasksByType (const DtSimTaskMessageType &taskType) |
| Clears any tasks of the specified type running in this controller. | |
| virtual void | clearTaskById (int taskId) |
| Clears any task of the specified ID running in this controller. | |
| virtual std::list < DtTaskMessage * > | currentTaskMessages () const |
| | |
| virtual DtTaskWithTaskStateListPtr | topLevelTasks () const |
| | |
Public Member Functions inherited from DtTaskControllerComponent | |
| DtTaskControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString& name, | |
| virtual | ~DtTaskControllerComponent () |
| destructor | |
| virtual bool | showCurrentTaskInGui () const |
| virtual void | setRadio (DtSimBaseRadio *radio) |
| Calls registerTaskMsgCallbacks. | |
| virtual void | addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr) |
| Adds a new function for processing the specified task type. | |
| virtual void | addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr) |
| Deprecated form of addTaskProcessorCallback. | |
| virtual void | removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr) |
| Undoes anything done by addTaskProcessorCallback(). | |
| virtual void | removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr) |
| Deprecated form of removeTaskProcessorCallback. | |
| virtual void | enable () |
| Overridden to call registerTaskMsgCallbacks(). | |
| virtual void | disable () |
| Overridden to 1) remove any task message callbacks registered by this controller 2) call clear task. | |
| virtual void | sendTaskCanceled (DtTaskMessage *taskMsg) |
| Sends the task canceled report for the specified message. | |
| virtual void | setTasked (bool tasked) |
| The current tasked state of this controller. | |
| virtual bool | tasked () const |
| The current tasked state of this controller. | |
Public Member Functions inherited from DtControllerComponent | |
| DtControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString& name, | |
| virtual | ~DtControllerComponent () |
| destructor | |
| virtual DtSimBaseRadio * | radio () |
| The radio this component is listening to. | |
Public Member Functions inherited from DtSimComponent | |
| DtSimComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtSimComponent () |
| destructor | |
| void | setParentSystem (DtComponentSystem *system) |
| Sets the parent system of this component. | |
| virtual bool | postAddComponentsInit () |
| Called after all components have been created, initialized and added to the component manager. | |
| virtual void | preFirstTickInit () |
| This function can be overridden to initialize a component before it is ticked for the first time. | |
| virtual void | timedTick () |
| This version of tick checks to see if the time to tick has arrived. | |
| virtual void | setMinTickPeriod (double minTickPeriod) |
| specifies a minimum tick period (which can also be thought of as | |
| virtual double | minTickPeriod () const |
| access the minimum tick period | |
| virtual void | setMinTickPeriodVariance (double minTickPeriodVariance) |
| set the variance in the minimum tick time | |
| virtual double | minTickPeriodVariance () const |
| access the variance in the minimum tick period | |
| virtual void | setNextTickTime (double nextTickTime) |
| The next tick time is normally calculated internally. | |
| virtual double | nextTickTime () const |
| access the next tick time | |
| virtual double | calculateNextTickTime () const |
| The next tick time is equal to mySimManager->exerciseClock()-> approximateElapsedRealTime() + myMinTickPeriod + a random # between -myMinTickPeriodVariance/2. | |
| virtual double | calculateFirstTickTime () const |
| Returns the first time value that the component should tick at. | |
| virtual void | setEntity (DtVrfObject *entity) |
| The entity's state repository is the place that actuator components make updates and other components look to see our current state. | |
| virtual DtSimComponent * | nextComponent () |
| List management functions. | |
| virtual DtSimComponent * | prevComponent () |
| virtual void | setListItem (DtListItem *item) |
| Used by DtComponentList. | |
| virtual DtListItem * | listItem () |
| virtual void | putData (FILE *fp, int indentLevel=0) |
| putData writes our type, which is provided by the virtual type accessor of the deriving class. | |
| virtual DtlObjPtr | getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings) |
| getData is just used to get us past the type in the data stream, since it's not actual stored. | |
| virtual void | addInputPort (DtInputPort *port) |
| Adds this input port to the components input port list so that other components can look it up and attach to it. | |
| virtual void | removeInputPort (DtInputPort *port) |
| virtual DtInputPort * | lookupInputPort (const DtString &portName) |
| Returns a pointer to the input port registered on this component with the specified name. | |
| virtual DtList | inputPortList () const |
| Returns the list of DtInputPorts registered on this component. | |
| virtual void | addOutputPort (DtOutputPort *port) |
| Adds this output port to the components output port list so that other components can look it up and attach to it. | |
| virtual void | removeOutputPort (DtOutputPort *port) |
| virtual DtOutputPort * | lookupOutputPort (const DtString &portName) |
| Returns a pointer to the output port registered on this component with the specified name. | |
| virtual DtList | outputPortList () const |
| Returns the list of DtOutputPorts registered on this component. | |
| virtual void | addInputPortGroup (DtInputPortGroup *group) |
| Adds this input port to the components input port list so that other components can look it up and attach to it. | |
| virtual void | removeInputPortGroup (DtInputPortGroup *group) |
| virtual DtInputPortGroup * | lookupInputPortGroup (const DtString &groupName) |
| Returns a pointer the input port group registered on this component with the specified name. | |
| virtual DtList | inputPortGroupList () const |
| Returns the list of DtInputPortGroups registered on this component. | |
| virtual void | addOutputPortGroup (DtOutputPortGroup *group) |
| Adds this output port group to the components output port group list so that other components can look it up and attach to it. | |
| virtual void | removeOutputPortGroup (DtOutputPortGroup *group) |
| virtual DtOutputPortGroup * | lookupOutputPortGroup (const DtString &groupName) |
| Returns a pointer the output port group registered on this component with the specified name. | |
| virtual DtList | outputPortGroupList () const |
| Returns the list of DtOutputPortGroups registered on this component. | |
| virtual int | priority () const |
| Return the current connection priority for this component. | |
| virtual void | setPriority (int priority) |
| Sets a new connection priority for this component, and changes all current outgoing connections from this component to the new value. | |
| double | dT () const |
| This is the delta-t for this component, which may or may not be the same as the exerciseClock dT. | |
| virtual void | setDT (double deltaT) |
| Note that while dT is calculated internally, this makes it possible to 'lie' to the component about dT if necessary. | |
| virtual void | setComponentDescriptor (DtComponentDescriptor *componentDescriptor) |
| The component descriptor specified in the order of battle file or parameter file that was used to create this component. | |
| virtual const DtComponentDescriptor * | componentDescriptor () const |
| virtual bool | tickWhileDestroyed () const |
| If the component returns true here, it will be ticked regardless of the destroyed state of the host entity. | |
| DtVrfProcessStateRepositoryManager * | psrManager () |
| virtual DtString | componentFullName () const |
| virtual bool | isEnabled () |
| Is this component enabled or not. | |
| virtual void | setIsEnabled (bool yesNo) |
| Is this component enabled or not. | |
| virtual DtOutputStream & | objectConsoleDebug () const |
| virtual DtOutputStream & | objectConsoleVerbose () const |
| virtual DtOutputStream & | objectConsoleInfo () const |
| virtual DtOutputStream & | objectConsoleWarn () const |
| virtual DtOutputStream & | objectConsoleError () const |
| virtual DtSimResourceManager & | resourceManager () |
| virtual const DtSimResourceManager & | resourceManager () const |
Public Member Functions inherited from DtReaderWriter | |
| DtReaderWriter () | |
| default constructor | |
| DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| real constructor Setting the readonly flag prevents object from writing itself to the stream. | |
| DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| copy constructor | |
| DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| const DtReaderWriter & | operator= (const DtReaderWriter &orig) |
| assignment operator | |
| virtual | ~DtReaderWriter () |
| destructor | |
| virtual void | putSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename()) |
| Top level call to write itself to file. | |
| virtual void | getSelf (DtlObjPtr args, const DtFilename &searchPath=DtFilename::nullFilename(), const DtVariableBindingsList &variableBindings=nullVariableReference()) |
| Top level to read itself from an input stream. | |
| virtual void | writeSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename()) |
| Called from putSelf, calls myRegistry.putSelf which in turn calls putSelf on each reader/writer in the registry. | |
| virtual DtSymbolString | name () const |
| Accessor for name of this readable/writable object. | |
| virtual void | addAlias (const DtSymbolString &alias) |
| Add an alias as an alternative name for this object. | |
| virtual bool | hasAlias (const DtSymbolString &alias) |
| virtual const aliasContainer & | aliases () const |
| virtual void | setReadonly (bool flag) |
| Set read-only flag. | |
| virtual bool | isReadonly () const |
| virtual bool | variableIsBound () const |
| virtual void | unbindVariable () |
| Sets the myVariableIsBound flag to false. | |
| virtual void | setName (const DtString &) |
| Set the name of the object. | |
| virtual const char * | readerWriterType () const |
| Used to supply a string type that this reader writer type is. | |
| virtual DtString | prettyPrint () const |
| Routine to return a human readable form of the reader/writer variable. | |
| virtual void | bindVariables (DtVariableBindingsList variableBindings) |
| Runs a variable binding pass on this reader writer and any of its children. | |
| virtual std::list < DtVariableNameType > | unboundVariables () const |
| bool | invalid () const |
| virtual bool | hasChild (const DtReaderWriter *p) const |
| Returns true if this variable has a child p in it's chain. | |
| virtual void | setValueSpecified (bool specified, bool recurse=false) |
| The specified flags are used for optional values. | |
| virtual bool | valueSpecified () const |
| The specified flags are used for optional values. | |
| virtual bool | isVariableReference () const |
| Specifies whether or not this reader writer is really a variable that is specified elsewhere. | |
| virtual void | setIsVariableReference (bool value) |
| virtual DtSymbolString | variableName () const |
| The variable name, if this object is a variable reference. | |
| virtual void | setVariableName (const DtSymbolString variableName) |
| The variable name, if this object is a variable reference. | |
| const DtReaderWriterRegistry & | registry () const |
| Collection of child DtReaderWriter nodes owned by this object. | |
| DtReaderWriterRegistry & | registry () |
| Collection of child DtReaderWriter nodes owned by this object. | |
Static Public Member Functions | |
| static void | moveAlongTaskCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState) |
| Callback registered with radio, invoked upon receipt of a DtMoveAlongTask. | |
| static void | taskCompleteReportCallback (DtSimMessage *msg, void *usr) |
| Callback registered with radio, invoked upon receipt of a DtTaskCompleteReport. | |
| static void | formationChangedCallback (const DtFormationState &formationState, void *usr) |
| Callback registered with formation state object (in aggregate state repository), invoked in the event that the formation state has changed. | |
| static void | routeChangedCallback (DtVrfObject *obj, void *usr) |
| Callback registered with the DtVrfObject representing the route we're following, for notification when thevroute vertices change. | |
| static void | objectAddedCb (DtVrfObject *vrfObject, void *usr) |
| Callback registered with DtVrfObjectManager for notification when objects are added. | |
| static void | objectAboutToBeRemovedCb (DtVrfObject *vrfObject, void *usr) |
| Callback registered with DtVrfObjectManager for notification when objects are removed. | |
| static void | objectManagerRemoveAndDeleteAllCallback (const DtVrfObjectManager &objectManager, void *usr) |
| Callback to be invoked when the DtVrfObjectManager's removeAndDeleteAll() member function is about to be invoked. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual void | initializeMoveAlongTask (DtVrfObject &route, DtIteratorDirection traversalDirection, bool startAtClosestPoint, DtSimTaskStatePtr taskState) |
| Initializes move along task, setting name of the route in myProcessState, registering the routeChangedCallback with the given route. | |
| virtual void | processFormationChanged (const DtFormationState &formationState) |
| If currently tasked and in the moving along route phase, calls reevaluateMoveAlongAssignments(). | |
| virtual void | processMoveAlongTask (DtSimMessage *msg, DtSimTaskStatePtr taskState) |
| Unpacks DtMoveAlongTask and calls moveAlong(). | |
| virtual void | processTaskComplete (DtSimMessage *msg) |
| If task complete report is a DtMoveAlongTask, remove corresponding entry from myCurrentlyTaskedSubordinateEchelonIds. | |
| virtual void | processRouteChanged (const DtVrfObject &obj) |
| Regenerates routes. | |
| virtual void | processObjectAdded (DtVrfObject *vrfObject) |
| Checks given vrfObject against the route we're looking for. | |
| virtual void | processObjectAboutToBeRemoved (DtVrfObject *vrfObject) |
| Checks given vrfObject against the route we're looking for. | |
| virtual void | moveTo (const DtString &routeName, bool traverseForward) |
| Issue DtMoveIntoFormation task as subtask to ourself. | |
| virtual void | moveAlong (const DtString &route, bool traverseForward, bool startAtClosestPoint) |
| Generate separate route for each subordinate, and then task subordinate to follow its own route. | |
| virtual void | generateFormationRoutes (const DtVrfObject &route, bool reverseDirection) |
| Generate routes for subordinates to follow, at offsets corresponding to their position in formation. | |
| virtual void | buildEntityRouteFollowingMap (std::map< DtVrfObject *, DtEntityRouteFollowingData > &map) |
| Generate map of which subordinate is following which generated route. | |
| virtual void | sendTaskToSubordinate (const DtSimTask &task, const DtString &subordinateObjectName) const |
| Constructs task messages and sends it to given subordinate through myRadio. | |
| virtual void | sendSetDataToSubordinate (const DtSetDataRequest &setData, const DtString &subordinateObjectName) const |
| Constructs set data request message and sends it to given subordinate through myRadio. | |
| virtual void | deleteFormationRoutes () |
| Delete all formation routes (routes generated by this controller). | |
| virtual void | onObjectManagerRemoveAndDeleteAll (const DtVrfObjectManager &objectManager) |
| De-registers for formation changed callbacks. | |
| virtual bool | calculateInitialPositionAndHeadingAlongRoute (const DtVrfObject &route, bool traverseForward, DtVector &initialPosition, double &initialHeading) |
| Determines location and heading of aggregate at the logical beginning of the route the aggregate wants to follow. | |
| virtual void | sendVrfObjectModifyMsg (const DtEntityIdentifier &id, DtList *vertices) const |
| Sends DtIfModifyVrfObject interface message for given object id, with updated set of vertices. | |
| virtual void | initializeNextRouteIndex () |
| Initialize counter used to generate working route names. | |
| virtual unsigned int | nextRouteIndex () |
| Next available index to use when constructing working route names. | |
| virtual bool | buildOffsetRoute (const DtList &localRouteVertexList, const DtVector &bodyOffset, bool reverseDirection, bool generateRoutesWithRoundedCorners, double vertexSpacingAlongRoundedCorners, DtList &geocentricOffsetRouteVertexList) |
| Builds route at body offset relative to given route. | |
| virtual void | registerRouteCallbacksIfNeeded () |
| If tasked and we have not yet registered any callbacks with move-along route, register callbacks to either discover route, or be notified when route changes and when it is about to be removed. | |
| virtual void | initializeMemberDataFromDescriptor (const DtAggregateMoveAlongDescriptor &desc) |
| Initializes myGenerateRoutesWithRoundedCorners, myVertexSpacingAlongRoundedCorners, myMaintainFormationTickInterval, and myMaintainFormationMonitor data members with data in descriptor. | |
| virtual void | maintainMovementInFormation () |
| If currently tasked and in the moving along route state, montiors subordinates' speed using myMaintainFormationMonitor, and calls task complete if behavior is complete. | |
| virtual void | reevaluateMoveAlongAssignments () |
| Prunes entities no longer part of current formation from process state repository. | |
| virtual void | sendClearTask (const DtString &recipientName, const DtSimTaskMessageType &taskType) const |
| Sends a clear task request to the given receipient on this entity's command radio. | |
| virtual bool | adjustOffsetRouteStart (std::vector< DtVector > &route) const |
| Adjusts the start of a given offset route. | |
| virtual bool | adjustOffsetRouteEnd (std::vector< DtVector > &route) const |
| Adjusts the ending point of a given offset route. | |
| virtual bool | extendRouteStart (std::vector< DtVector > &route, double distance) const |
| Extends route by given distance at start of route, extending the first segment by the given distance. | |
| virtual bool | clipRouteEnd (std::vector< DtVector > &route, double distance) const |
| Clips end of given route by distance. | |
| virtual DtMaintainFormationMonitor * | createFormationMonitor (DtVrfObject *entity) const |
| Creates an instance of a DtMaintainFormationMonitor. | |
| virtual bool | publishFormationRoutes () const |
| virtual bool | shouldGroundClamp () const |
Protected Member Functions inherited from DtSingleTaskControllerComponent | |
| virtual void | clearPendingSubtasks () |
| Iterates over collection of all pending subtasks for this controller, and calls clearSubtask() for each subtask type. | |
| virtual void | clearSubtasksByType (const DtSimTaskMessageType &taskType) |
| Clear all subtasks of a given type. | |
Protected Attributes | |
| std::map< int, DtString > | myPromotionIndexRouteNameMap |
| Map of formation positions to generated route object names. | |
| DtMaintainFormationMonitor * | myMaintainFormationMonitor |
| Object that monitors current subordinate positions and adjusts them if necessary to maintain correct formation shape while moving. | |
| double | myMaintainFormationTickInterval |
| Simulation time interval at which myMaintainFormationMonitor should be ticked. | |
| double | myTimeToNextMaintainFormationTick |
| Simulation time for next tick of myMaintainFormationMonitor. | |
| std::map< DtVrfObject *, DtEntityRouteFollowingData > | myEntityRouteFollowingMap |
| Map of subordinates and route following data. | |
| std::map< DtVrfObject *, DtEntityRouteTraversalState > | myEntityRouteTraversalStateMap |
| Map of subordinate and current route traversal state. | |
| DtVrfAggregateStateRepository * | myAggregateStateRepository |
| Pointer to aggregate's state repository, cached in this class for convenience. | |
| DtFormationState * | myFormationState |
| Pointer to aggregate's formation state object, cached in this class for convenience. | |
| DtCommandChannelRadio * | myCommandRadio |
| Pointer to aggregate's command radio, cached in this class for convenience. | |
| bool | myGenerateRoutesWithRoundedCorners |
| Flag indicating all generated route should have rounded turns. | |
| double | myVertexSpacingAlongRoundedCorners |
| Spacing in meters between extra vertices inserted in generated routes to form rounded turns. | |
| DtAggregateMoveAlongPSR * | myProcessState |
| Container for state data associated with this component. | |
| const DtAggregateMoveAlongDescriptor * | myAggregateMoveAlongDescriptor |
| Pointer to descriptor used to configure this object. | |
| bool | myRegisteredFormationChangedCallback |
| Flag used to indicate whether formation changed callback has been registered yet. | |
| bool | myRegisteredObjectCallbacks |
| Flag used to indcate whether route added/changed/removed callbacks have yet been registered. | |
| bool | myFirstTick |
| Flag used to indicate first non-zero dT() tick. | |
| unsigned int | myNextRouteIndex |
| Counter used in naming generated routes. | |
| DtSimTaskStatePtr | myCachedTaskState |
Private Member Functions | |
| DtDisaggregatedMoveAlongController () | |
| default constructor - not implemented | |
| DtDisaggregatedMoveAlongController (const DtDisaggregatedMoveAlongController &orig) | |
| copy constructor - not implemented | |
| DtDisaggregatedMoveAlongController & | operator= (const DtDisaggregatedMoveAlongController &orig) |
| assignment operator - not implemented | |
Additional Inherited Members | |
Public Types inherited from DtReaderWriter | |
| typedef std::vector < DtSymbolString > | aliasContainer |
| typedef std::vector < DtSymbolString >::iterator | aliasIter |
| typedef std::vector < DtSymbolString > ::const_iterator | aliasConstIter |
| typedef std::pair < DtSymbolString, DtString > | DtVariableNameType |
Protected Types inherited from DtTaskControllerComponent | |
| typedef std::pair < DtTaskMessageCallbackFcn, void * > | DtTaskCallbackMapPair |
| This map stores callbacks that have been registered to processes various tasks. | |
| typedef std::map < DtSimTaskMessageType, DtTaskCallbackMapPair > | DtTaskCallbackMap |
Static Protected Attributes inherited from DtSimComponent | |
| static DtSimComponentFactory * | myFactory |
Class DtDisaggregatedMoveAlongController is a task controller that models aggregate entity move-along-route behavior.
End User Description: The DtDisaggregatedMoveAlongController models movement along a route for aggregate entities. It handles execution of DtMoveAlongTasks. Movement is implemented by creating temporary working routes for each subordinate, positioned at an offset needed to maintain that subordinate's position in formation. The controller periodically monitors subordinate's relative positions to one another and issues DtSetSpeedRequests at a relatively faster or slower speed than the ordered speed. In this way, the controller attempts to maintain the shape of the formation as the subordinates move. The movement task is considered is considered complete when all subordinates have reached the end of the route and have issued task complete reports to the aggregate. At that point, the aggregate destroys the temporary working routes and the task ends.
This controller may only be configured as a part of an entity that has a vrf-aggregate-state-repository.
Developer Description: The DtDisaggregatedMoveAlongController class registers a callback for handling DtMoveAlongTasks. When it receives a DtMoveAlongTask, it queries the aggregate's DtFormationState repository in the state repository for the current positions of its taskable subordinates in the current formation. It then creates a set of 'working' routes parallel to the original route, based on the offsets obtained from the formation state repository. It registers callbacks for handling changes to formation state, changes to route vertices, and unexpected removal of route while tasked to move along route.
Uses Descriptor Type: DtAggregateMoveAlongDescriptor
| DtDisaggregatedMoveAlongController::DtDisaggregatedMoveAlongController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
|
virtual |
destructor
|
private |
default constructor - not implemented
|
private |
copy constructor - not implemented
|
virtual |
Returns a string identifies the class type of component.
Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.
Implements DtTaskControllerComponent.
|
virtual |
Initialize myAggregateStateRepository, myFormationState, and myAggregateMoveAlongDescriptor member variables.
Registers formationChangedCallback member function with myFormationState. Calls initializeMemberDataFromDescriptor() to initializes class members with data in myAggregateMoveAlongDescriptor.
Reimplemented from DtControllerComponent.
|
virtual |
Registers moveAlongTaskCallback member function for DtMoveAlongType tasks on radio (for tasks issued in GUI or by superior).
Registers taskCompleteReportCallback member function for DtTaskComplete reports on radio and command radio (so it can receive task complete reports from itself and its subordinates, respectively).
Reimplemented from DtTaskControllerComponent.
|
virtual |
Calls registerRouteCallbacksIfNeeded() to register route-related callbacks so we can be notified in the event the route changes.
Calls taskStateFromPre3_8Scenario() to check if current tasked state has been read in from a pre-3.8 scenario. If true, calls upgradeTaskStateFromPre3_8Scenario() to update task state to current version. Calls initializerRouteIndex() initialize myNextRouteIndex member from process state repository. Calls maintainMovementInFormation() to maintain relative formation positions, if we're currently tasked and moving along the route.
Reimplemented from DtSimComponent.
|
virtual |
If tasked, clears out myProcessState, sends clear task messages to any subordinates that are currently tasked, and calls deleteFormationRoutes() to remove any working routes this controller has created.
Override to send clear task messages to subordinates and delete working routes, if currently tasked.
Reimplemented from DtSingleTaskControllerComponent.
|
virtual |
Creates myProcessState data member, and adds it to our process state repository manager.
Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.
|
virtual |
Returns pointer to a DtMoveAlongTaskState object containing status of our current move-along task.
Reimplemented from DtSingleTaskControllerComponent.
|
static |
Callback registered with radio, invoked upon receipt of a DtMoveAlongTask.
Calls processMoveAlongTask() to handle the task message.
| msg | Message containing DtMoveAlongTask. |
| usr | Pointer to instance of this class. |
|
static |
Callback registered with radio, invoked upon receipt of a DtTaskCompleteReport.
Calls processTaskComplete() to handle the report.
| msg | Message containing DtTaskCompleteReport. |
| usr | Pointer to instance of this class. |
|
static |
Callback registered with formation state object (in aggregate state repository), invoked in the event that the formation state has changed.
Calls processFormationChanged to handle the event.
| formationState | Formation state repository for the aggregate (maintained in aggegate state repository). |
| usr | Pointer to instance of this class. |
|
static |
Callback registered with the DtVrfObject representing the route we're following, for notification when thevroute vertices change.
Calls processRouteChanged().
| obj | Pointer to the route we're following. |
| usr | Pointer to instance of this class. |
|
static |
Callback registered with DtVrfObjectManager for notification when objects are added.
Calls processObjectAdded() to handle the event.
| vrfObject | Pointer to object just added to object manager (could be any type of object – entity, aggregate, control object). |
| usr | Pointer to instance of this class. |
|
static |
Callback registered with DtVrfObjectManager for notification when objects are removed.
Calls processObjectAboutToBeRemoved().
| vrfObject | Pointer to object representing the route we're following. |
| usr | Pointer to instance of this class. |
|
static |
Callback to be invoked when the DtVrfObjectManager's removeAndDeleteAll() member function is about to be invoked.
Calls onObjectManagerRemoveAndDeleteAll().
| objectManager | The object manager maintinaing all simulated objects in a VR-Forces back-end. |
| usr | Pointer to an instance of this class. |
|
static |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
|
protectedvirtual |
Initializes move along task, setting name of the route in myProcessState, registering the routeChangedCallback with the given route.
If startAtClosest is true, calls moveAlong() to starting moving along the route immediately. Otherwise calls moveTo() to move the aggregate to a starting point at the appropriate end of the route.
| route | The route we're tasked to follow. |
| traversalDirection | The direction we want to follow the route. A value of DtIteratorForward indicates route should be traversed in order of increasing vertex index, DtIteratorReverse indicates traversal should be in order of decreasing vertex index. |
| startAtClosestPoint | This flag indicates whether traversal should start at closest vertex (true), or at the logical beginning of the route (false). |
|
protectedvirtual |
If currently tasked and in the moving along route phase, calls reevaluateMoveAlongAssignments().
| formationState | Formation state maintained in our aggregate's state repository. |
|
protectedvirtual |
Unpacks DtMoveAlongTask and calls moveAlong().
| msg | Message containing DtMoveAlongTask. |
|
protectedvirtual |
If task complete report is a DtMoveAlongTask, remove corresponding entry from myCurrentlyTaskedSubordinateEchelonIds.
If myCurrentlyTaskedSubordinateEchelonIds is empty, calls taskComplete().
| msg | Message containing DtTaskCompleteReport. |
|
protectedvirtual |
Regenerates routes.
| obj | The route we're currently following. |
|
protectedvirtual |
Checks given vrfObject against the route we're looking for.
If it is ours, registers a vertices-changed callback on the object. This way we can detect if the route changes while we're trying to follow it.
| vrfObject | Pointer to the object just added to the object manager. May be any type of DtVrfObject (entity, aggregate, control object). |
|
protectedvirtual |
Checks given vrfObject against the route we're looking for.
If it is the route we're following, calls clearTask().
| vrfObject | Pointer to the object about to be removed from the object manager. May be any type of DtVrfObject (entity, aggregate, control object). |
|
protectedvirtual |
Issue DtMoveIntoFormation task as subtask to ourself.
| routeName | The object name of the route we're tasked to move along. |
| traverseForward | Flag indicating if route should be traversed in order of increasing vertex index (DtIteratorForward) or decreasing vertex index (DtIteratorReverse). |
|
protectedvirtual |
Generate separate route for each subordinate, and then task subordinate to follow its own route.
| route | Object name of the route we are tasked to follow. |
| traverseForward | Flag indicating if route should be traversed in order of increasing vertex index (DtIteratorForward) or decreasing vertex index (DtIteratorReverse). |
| startAtClosestPoint | This flag indicates whether traversal should start at closest vertex (true), or at the logical beginning of the route (false). |
|
protectedvirtual |
Generate routes for subordinates to follow, at offsets corresponding to their position in formation.
| route | Object name of the route we are following. |
| reverseDirection | Flag indicating if traversal direction is reverse (false) or forward (true). |
|
protectedvirtual |
Generate map of which subordinate is following which generated route.
| map | Map of subordinates versus current route following state (such as identity of route subordinate should follow, current vertex, and so on). |
|
protectedvirtual |
Constructs task messages and sends it to given subordinate through myRadio.
| task | Task to be issued to a subordinate. |
| subordinateObjectName | Object name of the subordinate to be given the task. |
|
protectedvirtual |
Constructs set data request message and sends it to given subordinate through myRadio.
| setData | Set data request to be issued to subordinate. |
| subordinateObjectName | Object name of the subordinate to be given the set data request. |
|
protectedvirtual |
Delete all formation routes (routes generated by this controller).
|
protectedvirtual |
De-registers for formation changed callbacks.
We don't want to be affected by intermediate changes to aggregate composition as objects are being cleaned up in the object manager.
| objectManager | Reference to the object manager that maintains all of the simulated object in a VR-Forces back-end. |
|
protectedvirtual |
Determines location and heading of aggregate at the logical beginning of the route the aggregate wants to follow.
Aggregate is positioned such that the lead entity in the current formation is at the start of the route.
| route | The route the aggregate is tasked to follow. |
| traverseForward | If true, route should be traversed in order of increasing route vertex index. If false, traversal should be in order of decreasing vertex index. |
| initialPosition | Initial position of aggregate at start of route in geocentric coordinates. Centers the aggregate at the start of the route. |
| initialHeading | Initial heading of aggregate at start of route, such that aggregate is aligned along first segment of route, in radians. |
|
protectedvirtual |
Sends DtIfModifyVrfObject interface message for given object id, with updated set of vertices.
Used to modify vertices of working route generated by this class whenever the route we're following changes.
| id | Entity identifier object to modify (one of the working routes). |
| vertices | List of DtVector* vertices in geocentric coordinates for the route. |
|
protectedvirtual |
Initialize counter used to generate working route names.
Sets it to lowest integer greater than that used by any routes stored in process state.
|
protectedvirtual |
Next available index to use when constructing working route names.
|
protectedvirtual |
Builds route at body offset relative to given route.
Generates a route parallel to the original route, at the given body offset. Then calls adjustOffsetRouteStart() followed by adjustOffsetRouteEnd() to modify the beginning and end of the route, respectively.
| localRouteVertexList | Original list of DtLocalRwVector vertices from route we're tasked to follow. |
| bodyOffset | Formation position offset in aggregate body coordinates of formation position, relative to center of mass of aggregate formation. |
| reverseDirection | If true, generate route in reverse direction relative to original route. If false, generate route in same direction as original route. |
| generateRoutesWithRoundedCorners | If true, round the edges of turns by inserting additional vertices in offset route. |
| vertexSpacingAlongRoundedCorners | Distance in meters between vertices inserted in offset route to create rounded corners. |
| geocentricOffsetRouteVertexList | List of DtVector* vertices in geocentric coordinates for new offset route. |
|
protectedvirtual |
If tasked and we have not yet registered any callbacks with move-along route, register callbacks to either discover route, or be notified when route changes and when it is about to be removed.
Registers objectAddedCb member function with object manger for notification when new objects are added to object manager, and objectAboutToBeRemovedCb member function when a given object is about to be removed. Registered routeChangedCallback when given route we're following vertices have changed.
|
protectedvirtual |
Initializes myGenerateRoutesWithRoundedCorners, myVertexSpacingAlongRoundedCorners, myMaintainFormationTickInterval, and myMaintainFormationMonitor data members with data in descriptor.
| desc | Descriptor used to configure this component. |
|
protectedvirtual |
If currently tasked and in the moving along route state, montiors subordinates' speed using myMaintainFormationMonitor, and calls task complete if behavior is complete.
If tasked, in the moving-along-route phase of task, and it is time to tick formation maonitor, calls myMaintainFormationMonitor->tick().
|
protectedvirtual |
Prunes entities no longer part of current formation from process state repository.
Removes routes associated with those entities from the process state repository and from the object manager. For remaining entities, adjusts formation routes to reflect their latest position in formation.
|
protectedvirtual |
Sends a clear task request to the given receipient on this entity's command radio.
| recipientName | Object name of the entity we want to have clear its task |
| taskType | Identifies the kind of task we want the recipient to clear (see radioMsgTypes.h for available task types) |
|
protectedvirtual |
Adjusts the start of a given offset route.
Calls extendRouteStart() with the the current formation half length to adjust the route such that the aggregate will line up with the leading entity at the start of the route.
|
protectedvirtual |
Adjusts the ending point of a given offset route.
Calls clipRouteEnd() with the the current formation half length to adjust the route such that the aggregate will line up with the leading entity at the end of the route.
|
protectedvirtual |
Extends route by given distance at start of route, extending the first segment by the given distance.
| route | List of vertices representing a route |
| distance | Amount to extend the first segment |
|
protectedvirtual |
Clips end of given route by distance.
| route | to be modified. |
| distance | Amount to be clipped back from end of route |
|
protectedvirtual |
Creates an instance of a DtMaintainFormationMonitor.
Override this function if you want to create derived kind of formation monitor to be used by this class.
| entity | Pointer to the entity using this formation monitor (myEntity). |
|
protectedvirtual |
|
protectedvirtual |
|
private |
assignment operator - not implemented
|
protected |
Map of formation positions to generated route object names.
|
protected |
Object that monitors current subordinate positions and adjusts them if necessary to maintain correct formation shape while moving.
Adjustment is made by sending DtSetSpeedRequest messages to subordinates, relatively faster or slower than ordered speed of the aggregate.
|
protected |
Simulation time interval at which myMaintainFormationMonitor should be ticked.
|
protected |
Simulation time for next tick of myMaintainFormationMonitor.
|
protected |
Map of subordinates and route following data.
|
protected |
Map of subordinate and current route traversal state.
|
protected |
Pointer to aggregate's state repository, cached in this class for convenience.
|
protected |
Pointer to aggregate's formation state object, cached in this class for convenience.
|
protected |
Pointer to aggregate's command radio, cached in this class for convenience.
Aggregates must be configured with a command radio for this controller to work properly.
|
protected |
Flag indicating all generated route should have rounded turns.
Default is true.
|
protected |
Spacing in meters between extra vertices inserted in generated routes to form rounded turns.
Default is 20 meters.
|
protected |
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
|
protected |
Pointer to descriptor used to configure this object.
|
protected |
Flag used to indicate whether formation changed callback has been registered yet.
|
protected |
Flag used to indcate whether route added/changed/removed callbacks have yet been registered.
This may not happen until sometime after the first non-zero dT() tick.
|
protected |
Flag used to indicate first non-zero dT() tick.
|
protected |
Counter used in naming generated routes.
Routes are assigned unique object names using the convention <original route="" name>="">_<myNextRouteIndex>.
|
protected |