VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtDisaggregatedMoveAlongController Class Reference

Class DtDisaggregatedMoveAlongController is a task controller that models aggregate entity move-along-route behavior. More...

Inheritance diagram for DtDisaggregatedMoveAlongController:
Inheritance graph
[legend]

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 const chartype () 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 void suspendTask ()
 This method is called when the currently running task is being suspended.
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 bool isSubtasked () const
 Returns true if this controller is currently subtasked.
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< intcurrentPendingSubstaskIds () 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 DtTaskMessagecurrentTaskMessage () 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 DtSuspendedTaskInfosuspendTaskById (int taskId)
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 (DtSimRadio *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 bool taskVisualizationsActive () const
 Returns true if task visualizations are currently active for this component.
virtual void setTasked (bool tasked)
 The current tasked state of this controller.
virtual bool tasked () const
- 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 DtSimRadioradio ()
 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 registerAttributeFunctions ()
 Called to register functions that provide system attribute values.
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 DtSimComponentnextComponent ()
 List management functions.
virtual DtSimComponentprevComponent ()
virtual void setListItem (DtListItem *item)
 Used by DtComponentList.
virtual DtListItem * listItem ()
virtual void putData (std::string &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 DtReaderWriter::SearchPaths &searchPaths, 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 DtInputPortlookupInputPort (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 DtOutputPortlookupOutputPort (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 DtInputPortGrouplookupInputPortGroup (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 DtOutputPortGrouplookupOutputPortGroup (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.
DtVrfProcessStateRepositoryManagerpsrManager ()
virtual DtString componentFullName () const
virtual DtPhysicalWorldphysicalWorld ()
 Gets the physical world that this component's entity exists in.
virtual const DtPhysicalWorldphysicalWorld () const
virtual DtAttachedTerrainterrainAttachedTo ()
 Gets the terrain that this component's entity is attached to, if any.
virtual const DtAttachedTerrainterrainAttachedTo () const
virtual DtVrfObjectentity ()
 Gets the entity.
virtual const DtVrfObjectentity () const
virtual DtSimManagersimManager ()
 Gets the sim manager.
virtual const DtSimManagersimManager () const
virtual const Coordinate_SystemcoordinateSystem () const
 Gets the coordinate system, as it should always exist if the physical world is in a valid state!
virtual Coordinate_SystemcoordinateSystem ()
virtual
DtVrfObjectStateRepository
localStateRepository ()
 Gets the local state repository.
virtual const
DtVrfObjectStateRepository
localStateRepository () const
virtual DtTaskVisualizationMaptaskVisualizations ()
 Returns the list of task visualizations for this component.
virtual bool taskVisualizationsEnabled () const
 Returns true if task visualizations are enabled for this component.
virtual bool isEnabled ()
virtual void setIsEnabled (bool yesNo)
virtual DtOutputStream & objectConsoleDebug (const DtString &channel="") const
virtual DtOutputStream & objectConsoleVerbose (const DtString &channel="") const
virtual DtOutputStream & objectConsoleInfo (const DtString &channel="") const
virtual DtOutputStream & objectConsoleWarn (const DtString &channel="") const
virtual DtOutputStream & objectConsoleError (const DtString &channel="") const
virtual DtSimResourceManagerresourceManager ()
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)
 pseudo-copy constructor
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 assignment operator
bool operator== (const DtReaderWriter &) const
 Equivalence operator.
bool operator!= (const DtReaderWriter &rhs)
virtual ~DtReaderWriter ()
 destructor
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Top level call to write itself to file.
virtual void postPutSelf ()
 Called after either version of put self (file or environment). Default is no-op.
virtual void prePutSelf ()
 Called before either version of put self (file or environment). Default is no-op.
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 Top level to read itself from an input stream.
virtual void postGetSelf ()
 Called after either version of getSelf (mtl or environment). Default is no-op.
virtual void preGetSelf ()
 Called before either version of get self (file or environment). Default is no-op.
virtual void writeSelf (std::string &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 void addAlias (const DtString &alias)
virtual bool hasAlias (const DtSymbolString &alias)
virtual const aliasContaineraliases () const
virtual void setReadonly (bool flag)
 Set read-only flag.
bool isReadonly () const
virtual void reset ()
 For those reader/writer items that support it, resets the reader/writer value to original state Default is no-op.
virtual int alignment () const
 For those items that are sent over the network via HLA, this will give the network alignment.
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 charreaderWriterType () const
 Used to supply a string type that this reader writer type is.
virtual const charxmlType () const
virtual DtString prettyPrint () const
 Routine to return a human readable form of the reader/writer variable.
std::string debugText () const
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 bool hasVariableReference () const
 Returns true if this item or any item in the registry (recursive) is a variable reference.
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 Checks to see if this RW object is a variable reference that can be bound using the provided bindings.
virtual void recordUpdateTime () const
 Can be implemented in subclasses to stamp the time when updated.
virtual bool wasUpdatedSince (DtTime t) const
 Can be implemented in subclasses to return true if an update occurred after the specified time.
virtual bool changedSinceLastChecked ()
 Returns true if this objects value has changed since the last time this function was called.
virtual bool peekChangedSinceLastChecked () const
 Returns the value that changedSinceLastChecked would return but does not reset the internal flag.
virtual DtlObjPtr getData (DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
virtual void setValueSpecified (bool specified, bool recurse=false)
 The specified flags are used for optional values.
virtual bool valueSpecified () const
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 void clearAllVariableReferenceFlags ()
 Clears out all variable reference flags from all readerwriter items in registry recursively.
virtual DtSymbolString variableName () const
 The variable name, if this object is a variable reference.
virtual void setVariableName (const DtSymbolString variableName)
virtual const DtReaderWriterdefaultRWValue () const
 The default value to use if the reader/writer object is a variable and that variable is not specified.
virtual DtReaderWriterdefaultRWValue ()
virtual void setDefaultRWValue (DtReaderWriter *)
 Previous default value, if exists, will be removed and replaced with a clone of the supplied variable.
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 Give the stream, if the stream contains a default value then set it here.
const DtReaderWriterRegistryregistry () const
 Collection of child DtReaderWriter nodes owned by this object.
DtReaderWriterRegistryregistry ()
virtual DtPropertyInterfaceproperty ()
virtual const DtPropertyInterfaceproperty () const
virtual DtString toXml () const
virtual bool toXml (const DtFilename &) const
 Writes contents of xml result to the given filename.
virtual bool fromXml (const DtString &)
 Restores object from given xml string. Returns true if valid.
virtual bool fromXmlFile (const DtFilename &)
 Restores object from given xml file.
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 Override to add attributes of actual data.
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 Called when the item is a variable reference.
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 Gets data from the environment value.
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 Called when the xml reader tries to parse an unknown reader/writer item. Default is a no-op.
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 Called when the item is a variable reference.

Static Public Member Functions

static void moveAlongCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskStatePtr)
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 DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual void processMoveAlong (const DtTaskMessage &msg, DtSimTaskStatePtr taskStatePtr)
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 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 DtUUID &route, bool traverseForward)
 Issue DtMoveIntoFormation task as subtask to ourself.
virtual void moveAlong (const DtUUID &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 DtUUID &subordinate) const
 Constructs task messages and sends it to given subordinate through myRadio.
virtual void sendSetDataToSubordinate (const DtSetDataRequest &setData, const DtUUID &subordinate) 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 DtUUID &object, 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 DtUUID &recipient, 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.
virtual void cleanupInactiveSubtaskStatus ()
 Clears out subtask status entries that are either completed or canceled which were started by this controller.
- Protected Member Functions inherited from DtTaskControllerComponent
virtual void suspendSubtasksOfTask (int taskId, DtSuspendedTaskInfo *suspendInfo)
 Suspends all running subtasks of taskId, and puts the suspend info for each of them as subtasks into the provided suspendInfo.
virtual DtSimTaskMessageType remapScriptId (const DtSimTaskMessageType &) const
 In case this is aliased, return the actual script id.
- Protected Member Functions inherited from DtControllerComponent
 DtControllerComponent ()
 default constructor
 DtControllerComponent (const DtControllerComponent &orig)
 copy constructor
const DtControllerComponentoperator= (const DtControllerComponent &orig)
 assignment operator
- Protected Member Functions inherited from DtSimComponent
virtual double computeCurrentTime ()
 Compute current time and myDT.
bool testInvariant () const
virtual bool createPortGroups ()
 Called by init.
virtual bool createPorts ()
 Called by init.
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 Creates a PSR for this component and registers it with the PSR manager.
virtual void updateTaskVisualizations ()
 Called to update task visualizations after every tick.
virtual void destroyTaskVisualizations ()
 Destroys all task visualizations for this component.
virtual void destroyTaskVisualization (const DtString &name)
 Destroys an existing task visualization.
virtual DtPointTaskVisualizationPtr pointTaskVisualization (const DtString &name)
 Finds an existing or creates a new point task visualization with the given name.
virtual DtLineTaskVisualizationPtr lineTaskVisualization (const DtString &name)
 Finds an existing or creates a new line task visualization with the given name.
virtual DtAreaTaskVisualizationPtr areaTaskVisualization (const DtString &name)
 Finds an existing or creates a new area task visualization with the given name.
virtual DtTextTaskVisualizationPtr textTaskVisualization (const DtString &name)
 Finds an existing or creates a new text task visualization with the given name.
double calculateNextTaskVisTickTime () const
 Determines the next time the task visualizations should be ticked.
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 Copies values from the specified DtReaderWriter.
- Protected Member Functions inherited from DtObjectDebugger< DtReaderWriter >
 DtObjectDebugger ()
 DtObjectDebugger (const DtObjectDebugger &)
 ~DtObjectDebugger ()
- Protected Member Functions inherited from DtObjectDebugger< DtSimComponent >
 DtObjectDebugger ()
 DtObjectDebugger (const DtObjectDebugger &)
 ~DtObjectDebugger ()

Protected Attributes

std::map< int, DtStringmyPromotionIndexRouteNameMap
 Map of formation positions to generated route object names.
DtMaintainFormationMonitormyMaintainFormationMonitor
 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.
DtVrfAggregateStateRepositorymyAggregateStateRepository
 Pointer to aggregate's state repository, cached in this class for convenience.
DtFormationStatemyFormationState
 Pointer to aggregate's formation state object, cached in this class for convenience.
DtCompatibilityRadiomyCommandRadio
 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.
DtAggregateMoveAlongPSRmyProcessState
 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
DtDisaggregatedMoveAlongControlleroperator= (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::vector< DtFilename > SearchPaths
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
- 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 DtSimComponentFactorymyFactory

Detailed Description

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

Constructor & Destructor Documentation

DtDisaggregatedMoveAlongController::DtDisaggregatedMoveAlongController ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

virtual DtDisaggregatedMoveAlongController::~DtDisaggregatedMoveAlongController ( )
virtual

destructor

DtDisaggregatedMoveAlongController::DtDisaggregatedMoveAlongController ( )
private

default constructor - not implemented

DtDisaggregatedMoveAlongController::DtDisaggregatedMoveAlongController ( const DtDisaggregatedMoveAlongController orig)
private

copy constructor - not implemented

Member Function Documentation

virtual const char* DtDisaggregatedMoveAlongController::type ( ) const
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. Warning: this function should always return the same pointer and it should be valid forever. This means the data should be static.

Returns
DtAggregateMoveAlongControllerType

Implements DtTaskControllerComponent.

virtual bool DtDisaggregatedMoveAlongController::init ( )
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 void DtDisaggregatedMoveAlongController::registerTaskMsgCallbacks ( )
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 void DtDisaggregatedMoveAlongController::tick ( )
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 void DtDisaggregatedMoveAlongController::clearTask ( )
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 bool DtDisaggregatedMoveAlongController::createPSR ( )
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 DtSimTaskStatePtr DtDisaggregatedMoveAlongController::currentTaskState ( ) const
virtual

Returns pointer to a DtMoveAlongTaskState object containing status of our current move-along task.

Reimplemented from DtSingleTaskControllerComponent.

static void DtDisaggregatedMoveAlongController::moveAlongCallback ( DtSimMessage msg,
void *  usr,
DtSimTaskStatePtr  taskStatePtr 
)
static
static void DtDisaggregatedMoveAlongController::taskCompleteReportCallback ( DtSimMessage msg,
void *  usr 
)
static

Callback registered with radio, invoked upon receipt of a DtTaskCompleteReport.

Calls processTaskComplete() to handle the report.

Parameters
msgMessage containing DtTaskCompleteReport.
usrPointer to instance of this class.
static void DtDisaggregatedMoveAlongController::formationChangedCallback ( const DtFormationState formationState,
void *  usr 
)
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.

Parameters
formationStateFormation state repository for the aggregate (maintained in aggegate state repository).
usrPointer to instance of this class.
static void DtDisaggregatedMoveAlongController::routeChangedCallback ( DtVrfObject obj,
void *  usr 
)
static

Callback registered with the DtVrfObject representing the route we're following, for notification when thevroute vertices change.

Calls processRouteChanged().

Parameters
objPointer to the route we're following.
usrPointer to instance of this class.
static void DtDisaggregatedMoveAlongController::objectAddedCb ( DtVrfObject vrfObject,
void *  usr 
)
static

Callback registered with DtVrfObjectManager for notification when objects are added.

Calls processObjectAdded() to handle the event.

Parameters
vrfObjectPointer to object just added to object manager (could be any type of object – entity, aggregate, control object).
usrPointer to instance of this class.
static void DtDisaggregatedMoveAlongController::objectAboutToBeRemovedCb ( DtVrfObject vrfObject,
void *  usr 
)
static

Callback registered with DtVrfObjectManager for notification when objects are removed.

Calls processObjectAboutToBeRemoved().

Parameters
vrfObjectPointer to object representing the route we're following.
usrPointer to instance of this class.
static void DtDisaggregatedMoveAlongController::objectManagerRemoveAndDeleteAllCallback ( const DtVrfObjectManager objectManager,
void *  usr 
)
static

Callback to be invoked when the DtVrfObjectManager's removeAndDeleteAll() member function is about to be invoked.

Calls onObjectManagerRemoveAndDeleteAll().

Parameters
objectManagerThe object manager maintinaing all simulated objects in a VR-Forces back-end.
usrPointer to an instance of this class.
static DtSimComponent* DtDisaggregatedMoveAlongController::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
static

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns
New instance of this class.
virtual void DtDisaggregatedMoveAlongController::processMoveAlong ( const DtTaskMessage msg,
DtSimTaskStatePtr  taskStatePtr 
)
protectedvirtual
virtual void DtDisaggregatedMoveAlongController::initializeMoveAlongTask ( DtVrfObject route,
DtIteratorDirection  traversalDirection,
bool  startAtClosestPoint,
DtSimTaskStatePtr  taskState 
)
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.

Parameters
routeThe route we're tasked to follow.
traversalDirectionThe 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.
startAtClosestPointThis flag indicates whether traversal should start at closest vertex (true), or at the logical beginning of the route (false).
virtual void DtDisaggregatedMoveAlongController::processFormationChanged ( const DtFormationState formationState)
protectedvirtual

If currently tasked and in the moving along route phase, calls reevaluateMoveAlongAssignments().

Parameters
formationStateFormation state maintained in our aggregate's state repository.
virtual void DtDisaggregatedMoveAlongController::processTaskComplete ( DtSimMessage msg)
protectedvirtual

If task complete report is a DtMoveAlongTask, remove corresponding entry from myCurrentlyTaskedSubordinateEchelonIds.

If myCurrentlyTaskedSubordinateEchelonIds is empty, calls taskComplete().

Parameters
msgMessage containing DtTaskCompleteReport.
virtual void DtDisaggregatedMoveAlongController::processRouteChanged ( const DtVrfObject obj)
protectedvirtual

Regenerates routes.

Parameters
objThe route we're currently following.
virtual void DtDisaggregatedMoveAlongController::processObjectAdded ( DtVrfObject vrfObject)
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.

Parameters
vrfObjectPointer to the object just added to the object manager. May be any type of DtVrfObject (entity, aggregate, control object).
virtual void DtDisaggregatedMoveAlongController::processObjectAboutToBeRemoved ( DtVrfObject vrfObject)
protectedvirtual

Checks given vrfObject against the route we're looking for.

If it is the route we're following, calls clearTask().

Parameters
vrfObjectPointer to the object about to be removed from the object manager. May be any type of DtVrfObject (entity, aggregate, control object).
virtual void DtDisaggregatedMoveAlongController::moveTo ( const DtUUID route,
bool  traverseForward 
)
protectedvirtual

Issue DtMoveIntoFormation task as subtask to ourself.

Parameters
routeNameThe object name of the route we're tasked to move along.
traverseForwardFlag indicating if route should be traversed in order of increasing vertex index (DtIteratorForward) or decreasing vertex index (DtIteratorReverse).
virtual void DtDisaggregatedMoveAlongController::moveAlong ( const DtUUID route,
bool  traverseForward,
bool  startAtClosestPoint 
)
protectedvirtual

Generate separate route for each subordinate, and then task subordinate to follow its own route.

Parameters
routeObject name of the route we are tasked to follow.
traverseForwardFlag indicating if route should be traversed in order of increasing vertex index (DtIteratorForward) or decreasing vertex index (DtIteratorReverse).
startAtClosestPointThis flag indicates whether traversal should start at closest vertex (true), or at the logical beginning of the route (false).
virtual void DtDisaggregatedMoveAlongController::generateFormationRoutes ( const DtVrfObject route,
bool  reverseDirection 
)
protectedvirtual

Generate routes for subordinates to follow, at offsets corresponding to their position in formation.

Parameters
routeObject name of the route we are following.
reverseDirectionFlag indicating if traversal direction is reverse (false) or forward (true).
virtual void DtDisaggregatedMoveAlongController::buildEntityRouteFollowingMap ( std::map< DtVrfObject *, DtEntityRouteFollowingData > &  map)
protectedvirtual

Generate map of which subordinate is following which generated route.

Parameters
mapMap of subordinates versus current route following state (such as identity of route subordinate should follow, current vertex, and so on).
virtual void DtDisaggregatedMoveAlongController::sendTaskToSubordinate ( const DtSimTask task,
const DtUUID subordinate 
) const
protectedvirtual

Constructs task messages and sends it to given subordinate through myRadio.

Parameters
taskTask to be issued to a subordinate.
subordinateObjectNameObject name of the subordinate to be given the task.
virtual void DtDisaggregatedMoveAlongController::sendSetDataToSubordinate ( const DtSetDataRequest setData,
const DtUUID subordinate 
) const
protectedvirtual

Constructs set data request message and sends it to given subordinate through myRadio.

Parameters
setDataSet data request to be issued to subordinate.
subordinateObjectNameObject name of the subordinate to be given the set data request.
virtual void DtDisaggregatedMoveAlongController::deleteFormationRoutes ( )
protectedvirtual

Delete all formation routes (routes generated by this controller).

virtual void DtDisaggregatedMoveAlongController::onObjectManagerRemoveAndDeleteAll ( const DtVrfObjectManager objectManager)
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.

Parameters
objectManagerReference to the object manager that maintains all of the simulated object in a VR-Forces back-end.
virtual bool DtDisaggregatedMoveAlongController::calculateInitialPositionAndHeadingAlongRoute ( const DtVrfObject route,
bool  traverseForward,
DtVector initialPosition,
double initialHeading 
)
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.

Parameters
routeThe route the aggregate is tasked to follow.
traverseForwardIf true, route should be traversed in order of increasing route vertex index. If false, traversal should be in order of decreasing vertex index.
initialPositionInitial position of aggregate at start of route in geocentric coordinates. Centers the aggregate at the start of the route.
initialHeadingInitial heading of aggregate at start of route, such that aggregate is aligned along first segment of route, in radians.
virtual void DtDisaggregatedMoveAlongController::sendVrfObjectModifyMsg ( const DtUUID object,
DtList *  vertices 
) const
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.

Parameters
idEntity identifier object to modify (one of the working routes).
verticesList of DtVector* vertices in geocentric coordinates for the route.
virtual void DtDisaggregatedMoveAlongController::initializeNextRouteIndex ( )
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.

virtual unsigned int DtDisaggregatedMoveAlongController::nextRouteIndex ( )
protectedvirtual

Next available index to use when constructing working route names.

virtual bool DtDisaggregatedMoveAlongController::buildOffsetRoute ( const DtList &  localRouteVertexList,
const DtVector bodyOffset,
bool  reverseDirection,
bool  generateRoutesWithRoundedCorners,
double  vertexSpacingAlongRoundedCorners,
DtList &  geocentricOffsetRouteVertexList 
)
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.

Parameters
localRouteVertexListOriginal list of DtLocalRwVector vertices from route we're tasked to follow.
bodyOffsetFormation position offset in aggregate body coordinates of formation position, relative to center of mass of aggregate formation.
reverseDirectionIf true, generate route in reverse direction relative to original route. If false, generate route in same direction as original route.
generateRoutesWithRoundedCornersIf true, round the edges of turns by inserting additional vertices in offset route.
vertexSpacingAlongRoundedCornersDistance in meters between vertices inserted in offset route to create rounded corners.
geocentricOffsetRouteVertexListList of DtVector* vertices in geocentric coordinates for new offset route.
Returns
true if offset route was built successfully, false if not
virtual void DtDisaggregatedMoveAlongController::registerRouteCallbacksIfNeeded ( )
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.

virtual void DtDisaggregatedMoveAlongController::initializeMemberDataFromDescriptor ( const DtAggregateMoveAlongDescriptor desc)
protectedvirtual

Initializes myGenerateRoutesWithRoundedCorners, myVertexSpacingAlongRoundedCorners, myMaintainFormationTickInterval, and myMaintainFormationMonitor data members with data in descriptor.

Parameters
descDescriptor used to configure this component.
virtual void DtDisaggregatedMoveAlongController::maintainMovementInFormation ( )
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().

virtual void DtDisaggregatedMoveAlongController::reevaluateMoveAlongAssignments ( )
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.

virtual void DtDisaggregatedMoveAlongController::sendClearTask ( const DtUUID recipient,
const DtSimTaskMessageType taskType 
) const
protectedvirtual

Sends a clear task request to the given receipient on this entity's command radio.

Parameters
recipientNameObject name of the entity we want to have clear its task
taskTypeIdentifies the kind of task we want the recipient to clear (see radioMsgTypes.h for available task types)
virtual bool DtDisaggregatedMoveAlongController::adjustOffsetRouteStart ( std::vector< DtVector > &  route) const
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.

Returns
true if route is successfully adjusted (route is still valid after adjustment), false otherwise.
virtual bool DtDisaggregatedMoveAlongController::adjustOffsetRouteEnd ( std::vector< DtVector > &  route) const
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.

Returns
true if route is successfully adjusted (route is still valid after adjustment), false otherwise.
virtual bool DtDisaggregatedMoveAlongController::extendRouteStart ( std::vector< DtVector > &  route,
double  distance 
) const
protectedvirtual

Extends route by given distance at start of route, extending the first segment by the given distance.

Parameters
routeList of vertices representing a route
distanceAmount to extend the first segment
Returns
true if route was successfully modified
virtual bool DtDisaggregatedMoveAlongController::clipRouteEnd ( std::vector< DtVector > &  route,
double  distance 
) const
protectedvirtual

Clips end of given route by distance.

Parameters
routeto be modified.
distanceAmount to be clipped back from end of route
Returns
true if route was successfully clipped back. Returns false if distance to clip is greater than length of route (in which case the route will have no vertices).
virtual DtMaintainFormationMonitor* DtDisaggregatedMoveAlongController::createFormationMonitor ( DtVrfObject entity) const
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.

Parameters
entityPointer to the entity using this formation monitor (myEntity).
virtual bool DtDisaggregatedMoveAlongController::publishFormationRoutes ( ) const
protectedvirtual
Returns
Look up whether or not we should publish formation following routes in DtVrfSettingsManager. Returns true if setting cannot be found.
virtual bool DtDisaggregatedMoveAlongController::shouldGroundClamp ( ) const
protectedvirtual
Returns
Boolean value indicating whether or not generated route vertices should be ground clamped or not.
DtDisaggregatedMoveAlongController& DtDisaggregatedMoveAlongController::operator= ( const DtDisaggregatedMoveAlongController orig)
private

assignment operator - not implemented

Member Data Documentation

std::map<int, DtString> DtDisaggregatedMoveAlongController::myPromotionIndexRouteNameMap
protected

Map of formation positions to generated route object names.

DtMaintainFormationMonitor* DtDisaggregatedMoveAlongController::myMaintainFormationMonitor
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.

double DtDisaggregatedMoveAlongController::myMaintainFormationTickInterval
protected

Simulation time interval at which myMaintainFormationMonitor should be ticked.

double DtDisaggregatedMoveAlongController::myTimeToNextMaintainFormationTick
protected

Simulation time for next tick of myMaintainFormationMonitor.

std::map<DtVrfObject*, DtEntityRouteFollowingData> DtDisaggregatedMoveAlongController::myEntityRouteFollowingMap
protected

Map of subordinates and route following data.

std::map<DtVrfObject*, DtEntityRouteTraversalState> DtDisaggregatedMoveAlongController::myEntityRouteTraversalStateMap
protected

Map of subordinate and current route traversal state.

DtVrfAggregateStateRepository* DtDisaggregatedMoveAlongController::myAggregateStateRepository
protected

Pointer to aggregate's state repository, cached in this class for convenience.

DtFormationState* DtDisaggregatedMoveAlongController::myFormationState
protected

Pointer to aggregate's formation state object, cached in this class for convenience.

DtCompatibilityRadio* DtDisaggregatedMoveAlongController::myCommandRadio
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.

bool DtDisaggregatedMoveAlongController::myGenerateRoutesWithRoundedCorners
protected

Flag indicating all generated route should have rounded turns.

Default is true.

double DtDisaggregatedMoveAlongController::myVertexSpacingAlongRoundedCorners
protected

Spacing in meters between extra vertices inserted in generated routes to form rounded turns.

Default is 20 meters.

DtAggregateMoveAlongPSR* DtDisaggregatedMoveAlongController::myProcessState
protected

Container for state data associated with this component.

This state is saved and restored as part of a scenario (or checkpoint).

const DtAggregateMoveAlongDescriptor* DtDisaggregatedMoveAlongController::myAggregateMoveAlongDescriptor
protected

Pointer to descriptor used to configure this object.

bool DtDisaggregatedMoveAlongController::myRegisteredFormationChangedCallback
protected

Flag used to indicate whether formation changed callback has been registered yet.

bool DtDisaggregatedMoveAlongController::myRegisteredObjectCallbacks
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.

bool DtDisaggregatedMoveAlongController::myFirstTick
protected

Flag used to indicate first non-zero dT() tick.

unsigned int DtDisaggregatedMoveAlongController::myNextRouteIndex
protected

Counter used in naming generated routes.

Routes are assigned unique object names using the convention <original route="" name>="">_<myNextRouteIndex>.

DtSimTaskStatePtr DtDisaggregatedMoveAlongController::myCachedTaskState
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)