VR-Forces 5.0.1 Developer's Guide
 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.

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

Inheritance diagram for DtDisaggregatedMoveAlongController:
Inheritance graph
[legend]

Public Member Functions

 DtDisaggregatedMoveAlongController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtDisaggregatedMoveAlongController ()
 
virtual const chartype () const
 
virtual bool init ()
 
virtual void registerTaskMsgCallbacks ()
 
virtual void tick ()
 
virtual void clearTask ()
 
virtual bool createPSR ()
 
virtual DtSimTaskStatePtr currentTaskState () const
 
- Public Member Functions inherited from DtSingleTaskControllerComponent
 DtSingleTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSingleTaskControllerComponent ()
 
virtual void postTick ()
 
virtual bool beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState)
 
virtual void taskNotify (const DtSimTask &task)
 
virtual void taskComplete (bool success=true)
 
virtual void suspendTask ()
 
virtual int sendSubtask (DtSimTask &task)
 
virtual void clearSubtask (int subtaskId)
 
virtual void addPendingSubtaskId (int subtaskId)
 
virtual bool findPendingSubtaskId (int subtaskId)
 
virtual bool isSubtasked () const
 
virtual void removePendingSubtaskId (int subtaskId)
 
virtual void removeAllPendingSubtaskIds ()
 
virtual std::vector< intcurrentPendingSubstaskIds () const
 
virtual void clearCurrentTaskMessage ()
 
virtual DtTaskMessagecurrentTaskMessage () const
 
virtual bool decideToGiveUpTask () const
 
virtual void giveUpTask ()
 
virtual bool taskActive (int taskId) const
 
virtual bool clearTopLevelTasks ()
 
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType)
 
virtual void clearTasksByType (const DtSimTaskMessageType &taskType)
 
virtual void clearTaskById (int taskId)
 
virtual DtSuspendedTaskInfosuspendTaskById (int taskId)
 
virtual DtSuspendedTaskInfosuspendSubtaskById (int taskId, int subtaskId)
 
virtual std::list
< DtTaskMessage * > 
currentTaskMessages () const
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const
 
virtual void disable ()
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtTaskControllerComponent ()
 
virtual bool showCurrentTaskInGui () const
 
virtual void setRadio (DtSimRadio *radio)
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void enable ()
 
virtual void sendTaskCanceled (DtTaskMessage *taskMsg)
 
virtual bool taskVisualizationsActive () const
 
virtual void setTasked (bool tasked)
 
virtual bool tasked () const
 
- Public Member Functions inherited from DtControllerComponent
 DtControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtControllerComponent ()
 
virtual bool postAddComponentsInit ()
 
virtual DtSimRadioradio ()
 
virtual void enableTaskTypes ()
 
virtual void disableTaskTypes ()
 
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSimComponent ()
 
virtual void setParentSystem (DtComponentSystem *system)
 
DtComponentSystemparentSystem () const
 
virtual void registerAttributeFunctions ()
 
virtual void preFirstTickInit ()
 
virtual void timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod)
 
virtual double minTickPeriod () const
 
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 
virtual double minTickPeriodVariance () const
 
virtual void setNextTickTime (double nextTickTime)
 
virtual double nextTickTime () const
 
virtual double calculateNextTickTime () const
 
virtual double calculateFirstTickTime () const
 
virtual void setEntity (DtLocalObject *entity)
 
virtual DtSimComponentnextComponent ()
 
virtual DtSimComponentprevComponent ()
 
virtual void setListItem (DtListItem *item)
 
virtual DtListItem * listItem ()
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void addInputPort (DtInputPort *port)
 
virtual void removeInputPort (DtInputPort *port)
 
virtual DtInputPortlookupInputPort (const DtString &portName)
 
virtual DtList inputPortList () const
 
virtual void addOutputPort (DtOutputPort *port)
 
virtual void removeOutputPort (DtOutputPort *port)
 
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 
virtual DtList outputPortList () const
 
virtual void addInputPortGroup (DtInputPortGroup *group)
 
virtual void removeInputPortGroup (DtInputPortGroup *group)
 
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 
virtual DtList inputPortGroupList () const
 
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
 
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 
virtual DtList outputPortGroupList () const
 
virtual int priority () const
 
virtual void setPriority (int priority)
 
double dT () const
 
virtual void setDT (double deltaT)
 
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 
virtual const
DtComponentDescriptor
componentDescriptor () const
 
virtual bool tickWhileDestroyed () const
 
DtVrfProcessStateRepositoryManagerpsrManager ()
 
virtual const DtSymbolStringcomponentFullName () const
 
DtPhysicalWorldphysicalWorld ()
 
const DtPhysicalWorldphysicalWorld () const
 
const DtAttachedTerrainterrainAttachedTo () const
 
DtLocalObjectentity ()
 
const DtLocalObjectentity () const
 
DtSimulationServicessimulationServices ()
 
const DtSimulationServicessimulationServices () const
 
const Coordinate_SystemcoordinateSystem () const
 
virtual bool taskVisualizationsEnabled () const
 
makVrf::DtTaskVisualizationMaptaskVisualizations ()
 
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 int notifyLevel () const
 
virtual DtSimResourceManagerresourceManager ()
 
virtual const
DtSimResourceManager
resourceManager () const
 
VRF4API_METHOD const
DtSimulationServices
simManager () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs)
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual void reset ()
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charreaderWriterType () const
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool wasUpdatedSince (DtTime t) const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
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())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Static Public Member Functions

static void moveAlongCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskStatePtr)
 
static void taskCompleteReportCallback (DtSimMessage *msg, void *usr)
 
static void formationChangedCallback (const DtFormationState &formationState, void *usr)
 
static DtSimComponentcreator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
- Static Public Member Functions inherited from DtTaskControllerComponent
static void deprecatedTaskProcessorCallbackAdapter (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
 
- Static Public Member Functions inherited from DtSimComponent
static DtSimComponentFactoryfactory ()
 
static void setFactory (DtSimComponentFactory *factory)
 
static DtSimComponentcreateComponent (const DtString &name, const DtString &type, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentSystem *parentSystem, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
static void addSimComponentCreatorFcn (const DtString &type, DtSimComponentCreatorFcn fcn)
 
static VRF4API_METHOD
DtSimComponent
MarkThreadSafe (DtSimComponent *comp)
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 

Protected Member Functions

virtual void processMoveAlong (const DtTaskMessage &msg, DtSimTaskStatePtr taskStatePtr)
 
virtual void initializeMoveAlongTask (DtIteratorDirection traversalDirection, bool startAtClosestPoint, double speed, DtSimTaskStatePtr taskState)
 
virtual void processFormationChanged (const DtFormationState &formationState)
 
virtual void processTaskComplete (DtSimMessage *msg)
 
virtual void processRouteChanged ()
 
virtual void moveTo (const DtUUID &route, bool traverseForward)
 
virtual void beginMoveAlong (const DtUUID &route, bool traverseForward, bool startAtClosestPoint, double speed)
 
virtual bool generateFormationRoutes (const DtSimObject &route, bool reverseDirection)
 
virtual void buildEntityRouteFollowingMap (std::map< const DtSimObject *, DtEntityRouteFollowingData > &map)
 
virtual void sendTaskToSubordinate (const DtSimTask &task, const DtUUID &subordinate) const
 
virtual void sendSetDataToSubordinate (const DtSetDataRequest &setData, const DtUUID &subordinate) const
 
virtual void deleteFormationRoutes ()
 
virtual bool calculateInitialPositionAndHeadingAlongRoute (const DtSimObject &route, bool traverseForward, DtVector &initialPosition, double &initialHeading)
 
virtual void sendVrfObjectModifyMsg (const DtUUID &object, DtList *vertices) const
 
virtual void initializeNextRouteIndex ()
 
virtual unsigned int nextRouteIndex ()
 
virtual bool buildOffsetRoute (const DtList &localRouteVertexList, const DtVector &bodyOffset, bool reverseDirection, bool generateRoutesWithRoundedCorners, double vertexSpacingAlongRoundedCorners, DtList &geocentricOffsetRouteVertexList, bool &dataAvailable)
 
virtual void initializeMemberDataFromDescriptor (const DtAggregateMoveAlongDescriptor &desc)
 
virtual void maintainMovementInFormation ()
 
virtual void reevaluateMoveAlongAssignments ()
 
virtual void reevaluateFormationMoveAlongAssignments ()
 
virtual void sendClearTask (const DtUUID &recipient, const DtSimTaskMessageType &taskType) const
 
virtual bool adjustOffsetRouteStart (std::vector< DtVector > &route, bool &dataAvailable) const
 
virtual bool adjustOffsetRouteEnd (std::vector< DtVector > &route, bool &dataAvailable) const
 
virtual bool extendRouteStart (std::vector< DtVector > &route, double distance) const
 
virtual bool clipRouteEnd (std::vector< DtVector > &route, double distance) const
 
virtual
DtMaintainFormationMonitor
createFormationMonitor (DtLocalObject *entity) const
 
virtual bool publishFormationRoutes () const
 
virtual bool shouldGroundClamp () const
 
- Protected Member Functions inherited from DtSingleTaskControllerComponent
virtual void clearPendingSubtasks ()
 
virtual void clearSubtasksByType (const DtSimTaskMessageType &taskType)
 
virtual void cleanupInactiveSubtaskStatus ()
 
- Protected Member Functions inherited from DtTaskControllerComponent
virtual void suspendSubtasksOfTask (int taskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual void suspendSubtaskOfTask (int taskId, int subtaskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual DtSimTaskMessageType remapScriptId (const DtSimTaskMessageType &) const
 
- Protected Member Functions inherited from DtControllerComponent
 DtControllerComponent ()
 
 DtControllerComponent (const DtControllerComponent &orig)
 
const DtControllerComponentoperator= (const DtControllerComponent &orig)
 
virtual void onRestore ()
 
virtual void initializeTargetingControlTableFromDescriptor (const DtReaderWriter *)
 
virtual void sendCapableSetsAndTasks ()
 
- Protected Member Functions inherited from DtSimComponent
virtual double computeCurrentTime ()
 
bool testInvariant () const
 
virtual bool createPortGroups ()
 
virtual bool createPorts ()
 
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 
virtual void updateTaskVisualizations ()
 
virtual void destroyTaskVisualizations ()
 
virtual void destroyTaskVisualization (const DtString &name)
 
virtual
makVrf::DtPointTaskVisualizationPtr 
pointTaskVisualization (const DtString &name)
 
virtual
makVrf::DtLineTaskVisualizationPtr 
lineTaskVisualization (const DtString &name)
 
virtual
makVrf::DtAreaTaskVisualizationPtr 
areaTaskVisualization (const DtString &name)
 
virtual
makVrf::DtTextTaskVisualizationPtr 
textTaskVisualization (const DtString &name)
 
double calculateNextTaskVisTickTime () const
 
DtVrfObjectStateRepositorylocalStateRepository ()
 
const DtVrfObjectStateRepositorylocalStateRepository () const
 
void addSimObjectPredicateCallback (DtSimObjectReference, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void removeSimObjectPredicateCallback (const DtSimObject *, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void invokeSimObjectPredicateCallbacks ()
 
virtual void clearPredicateCallbacks ()
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

std::map< int, DtStringmyPromotionIndexRouteNameMap
 
DtMaintainFormationMonitormyMaintainFormationMonitor
 
double myMaintainFormationTickInterval
 
double myTimeToNextMaintainFormationTick
 
std::map< const DtSimObject
*, DtEntityRouteFollowingData
myEntityRouteFollowingMap
 
std::map< const DtSimObject
*, DtEntityRouteTraversalState
myEntityRouteTraversalStateMap
 
DtVrfAggregateStateRepositorymyAggregateStateRepository
 
DtFormationStatemyFormationState
 
DtCompatibilityRadiomyCommandRadio
 
bool myGenerateRoutesWithRoundedCorners
 
double myVertexSpacingAlongRoundedCorners
 
DtAggregateMoveAlongPSRmyProcessState
 
const
DtAggregateMoveAlongDescriptor
myAggregateMoveAlongDescriptor
 
bool myRegisteredFormationChangedCallback
 
bool myFirstTick
 
unsigned int myNextRouteIndex
 
DtSimTaskStatePtr myCachedTaskState
 
bool mySetObjectToBeRemovedCallbacks
 
DtSimObjectReference myRoute
 
DtAggregateLocalObjectFacade myAggregateLocalObjectFacade
 
- Protected Attributes inherited from DtTaskControllerComponent
DtTaskCallbackMap myTaskCallbackMap
 
std::list
< DtTaskProcessorCallbackInfo * > 
myTaskProcessorCallbackInfoList
 
bool myTaskIsRunning
 
- Protected Attributes inherited from DtControllerComponent
DtSimRadiomyRadio
 
bool myTaskTypesEnabled
 
bool myInitialized
 
- Protected Attributes inherited from DtSimComponent
DtLocalObjectmyEntity
 
DtComponentSystemmySystem
 
DtListItem * myListItem
 
DtInputPortMap myInputPortList
 
DtOutputPortMap myOutputPortList
 
DtInputPortGroupMap myInputPortGroupList
 
DtOutputPortGroupMap myOutputPortGroupList
 
int myPriority
 
double myMinTickPeriod
 
double myMinTickPeriodVariance
 
double myNextTickTime
 
double myLastTickSimTime
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
bool myTickEveryFrame
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManager myPredicateCallbackManager
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Private Member Functions

 DtDisaggregatedMoveAlongController ()
 
 DtDisaggregatedMoveAlongController (const DtDisaggregatedMoveAlongController &orig)
 
DtDisaggregatedMoveAlongControlleroperator= (const DtDisaggregatedMoveAlongController &orig)
 

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
 
typedef std::map
< DtSimTaskMessageType,
DtTaskCallbackMapPair
DtTaskCallbackMap
 
- Protected Types inherited from DtSimComponent
typedef std::map< DtString,
DtInputPort * > 
DtInputPortMap
 
typedef std::map< DtString,
DtOutputPort * > 
DtOutputPortMap
 
typedef std::map< DtString,
DtInputPortGroup * > 
DtInputPortGroupMap
 
typedef std::map< DtString,
DtOutputPortGroup * > 
DtOutputPortGroupMap
 
- Static Protected Attributes inherited from DtSimComponent
static DtSimComponentFactorymyFactory
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Constructor & Destructor Documentation

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

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject 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).
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 aggregate state repository).
usrPointer to instance of this class.
static DtSimComponent* DtDisaggregatedMoveAlongController::creator ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
static

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject 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).
Returns
New instance of this class.
virtual void DtDisaggregatedMoveAlongController::processMoveAlong ( const DtTaskMessage msg,
DtSimTaskStatePtr  taskStatePtr 
)
protectedvirtual
virtual void DtDisaggregatedMoveAlongController::initializeMoveAlongTask ( DtIteratorDirection  traversalDirection,
bool  startAtClosestPoint,
double  speed,
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).
speedis either the speed specified in the task or ordered speed.
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 ( )
protectedvirtual

Regenerates routes.

Parameters
objThe route we're currently following.
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::beginMoveAlong ( const DtUUID route,
bool  traverseForward,
bool  startAtClosestPoint,
double  speed 
)
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).
speedis from task or ordered speed
virtual bool DtDisaggregatedMoveAlongController::generateFormationRoutes ( const DtSimObject route,
bool  reverseDirection 
)
protectedvirtual

Generate routes for subordinates to follow, at offsets corresponding to their position in formation. Saves them in PSR myPromotionIndexRouteMap.

Parameters
routeObject name of the route we are following.
reverseDirectionFlag indicating if traversal direction is reverse (false) or forward (true).
Returns
true if the function completed, false if it is still waiting for data
virtual void DtDisaggregatedMoveAlongController::buildEntityRouteFollowingMap ( std::map< const DtSimObject *, 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 bool DtDisaggregatedMoveAlongController::calculateInitialPositionAndHeadingAlongRoute ( const DtSimObject 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,
bool dataAvailable 
)
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.
dataAvailableWhether data was available to complete this operation.
Returns
true if offset route was built successfully, false if not
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, monitors 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, calls reevaluateFormationMoveAlongAssignments() to adjust formation routes to reflect their latest position in formation.

virtual void DtDisaggregatedMoveAlongController::reevaluateFormationMoveAlongAssignments ( )
protectedvirtual

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 recipient 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,
bool dataAvailable 
) 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,
bool dataAvailable 
) 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 ( DtLocalObject 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<const DtSimObject*, DtEntityRouteFollowingData> DtDisaggregatedMoveAlongController::myEntityRouteFollowingMap
protected

Map of subordinates and route following data.

std::map<const DtSimObject*, 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::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
bool DtDisaggregatedMoveAlongController::mySetObjectToBeRemovedCallbacks
protected
DtSimObjectReference DtDisaggregatedMoveAlongController::myRoute
protected
DtAggregateLocalObjectFacade DtDisaggregatedMoveAlongController::myAggregateLocalObjectFacade
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)