VR-Forces 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
DtDisaggregatedLeadFollowInFormationController Class Reference

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

End User Description: The DtDisaggregatedLeadFollowInFormationController models movement along a route for aggregate entities. It handles execution of DtMoveAlongTasks. Movement is implemented by creating a temporary working route for the leader, positioned at an offset needed to maintain the leader's position in formation. The other subordinate routes are handled by their subtask. Speed control is also handled by the subordinate subtasks. The movement task 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 route 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 DtDisaggregatedLeadFollowInFormationController class registers a callback for handling DtMoveAlongTasks. When it receives a DtMoveAlongTask, it creates a working route for the leader. Then it calls for subtasks LeadFormation and FollowInFormation. It registers callbacks for handling changes to formation state, and changes to route vertices.

Uses Descriptor Type: DtAggregateMoveAlongDescriptor

Inheritance diagram for DtDisaggregatedLeadFollowInFormationController:
Inheritance graph
[legend]

Public Member Functions

 DtDisaggregatedLeadFollowInFormationController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtDisaggregatedLeadFollowInFormationController ()
 
virtual const chartype () const
 
virtual bool init ()
 
virtual void registerTaskMsgCallbacks ()
 
virtual void preFirstTickInit ()
 
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=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtSingleTaskControllerComponent ()
 
virtual void postTick () override
 
virtual bool beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState) override
 
virtual void taskNotify (const DtSimTask &task) override
 
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 DtSubtaskStatusEntrysubtaskStatus (int subtaskId)
 
virtual void clearCurrentTaskMessage ()
 
virtual DtTaskMessagecurrentTaskMessage () const
 
virtual bool decideToGiveUpTask () const
 
virtual void giveUpTask ()
 
virtual bool taskActive (int taskId) const override
 
virtual bool clearTopLevelTasks () override
 
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType) override
 
virtual void clearTasksByType (const DtSimTaskMessageType &taskType) override
 
virtual void clearTaskById (int taskId) override
 
virtual DtSuspendedTaskInfosuspendTaskById (int taskId) override
 
virtual DtSuspendedTaskInfosuspendSubtaskById (int taskId, int subtaskId) override
 
virtual std::list
< DtTaskMessage * > 
currentTaskMessages () const
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const override
 
virtual void disable () override
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtTaskControllerComponent ()
 
virtual AcceptLevel acceptTask (const DtTaskMessage &task)
 
virtual bool showCurrentTaskInGui () const
 
virtual void setRadio (DtSimRadio *radio) override
 
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 () override
 
virtual void sendTaskCanceled (DtTaskMessage *taskMsg)
 
virtual bool taskVisualizationsActive () const override
 
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 () override
 
virtual DtSimRadioradio ()
 
virtual void enableTaskTypes ()
 
virtual void enableScriptedTask (const DtString &scriptId)
 
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 timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod, double minTickPeriodVariance)
 
virtual void setupFirstTickTime ()
 
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 void isClutterChanged ()
 
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) const
 
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 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 processFormationChanged (const DtFormationState &formationState)
 
virtual void processTaskComplete (DtSimMessage *msg)
 
virtual void processRouteChanged ()
 
virtual int sendTaskToSubordinate (const DtSimTask &task, const DtUUID &subordinate)
 
virtual void sendSetDataToSubordinate (const DtSetDataRequest &setData, const DtUUID &subordinate) const
 
virtual void beginFollowInFormation (const DtUUID &routeName, const bool startAtClosestPoint, const bool traverseForward)
 
virtual int findClosestSegmentIndex (DtVector testPoint, std::vector< DtVector > testRoute, DtPoint &closestSegmentLoc, double &distanceToSegment, int indexSegmentFloor=0)
 
virtual bool createLeaderOffsetRoute (const std::vector< DtVector > &localPoints, const double rightOffset, const double forwardOffset, DtUUID &routeUUID, DtUUID)
 
virtual bool isPlatformCapable (const DtUUID &platform) const
 
virtual int taskLeader (const DtUUID &leader, const DtSimObjectReferenceList &subs, const DtUUID &leaderRoute, const double formationWidth, const double formationLength)
 
virtual int taskFollower (const DtUUID &subEntity, const DtUUID &formationLeader, const DtUUID &unitRouteUUID, const double leaderForwardOffset, const bool doReverseRoute, const double vertexStartIndex)
 
virtual void sendVrfObjectModifyMsg (const DtUUID &object, DtList *vertices) const
 
virtual void initializeMemberDataFromDescriptor (const DtAggregateMoveAlongDescriptor &desc)
 
virtual bool isUnitMovementExhausted ()
 
virtual void sendClearTask (const DtUUID &recipient, const DtSimTaskMessageType &taskType) const
 
virtual bool publishFormationRoutes () const
 
virtual double dist2D (const DtVector &position1, const DtVector &position2, const Coordinate_System &coordinateSystem)
 
- 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 void setupTimedTickLogic (double minTickPeriod, double minTickPeriodVariance)
 
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
 
DtPropertyInterfacecachedNextFrameStateProperty (DtPropertyInterface **prop, const DtString &propName)
 
template<typename ValType >
void setCachedNextFrameStatePropertyValue (DtPropertyInterface **prop, const DtString &propName, ValType value)
 
const DtPropertyInterfacecachedCurrentFrameStateProperty (const DtPropertyInterface **prop, const DtString &propName) const
 
template<typename ValType >
bool getCachedCurrentFrameStatePropertyValue (const DtPropertyInterface **prop, const DtString &propName, ValType &value) 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
 
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
 
unsigned int myNextRouteIndex
 
DtSimTaskStatePtr myCachedTaskState
 
bool mySetObjectToBeRemovedCallbacks
 
DtSimObjectReference myRoute
 
bool myRestartTaskOnFormationUpdate
 
- 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 myLastTickSimTime
 
std::unique_ptr< DtTimedTickLogicmyTimedTickLogic
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManagermyPredicateCallbackManager
 
boost::signals2::scoped_connection myIsClutterChangedConnection
 
- 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

 DtDisaggregatedLeadFollowInFormationController ()
 
 DtDisaggregatedLeadFollowInFormationController (const DtDisaggregatedLeadFollowInFormationController &orig)
 
DtDisaggregatedLeadFollowInFormationControlleroperator= (const DtDisaggregatedLeadFollowInFormationController &orig)
 

Additional Inherited Members

- Public Types inherited from DtTaskControllerComponent
enum  AcceptLevel { AcceptLevel_Accept = 0, AcceptLevel_Partial = 1, AcceptLevel_Error = 2, AcceptLevel_NoAccept = 99 }
 
- 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

DtDisaggregatedLeadFollowInFormationController::DtDisaggregatedLeadFollowInFormationController ( 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 DtDisaggregatedLeadFollowInFormationController::~DtDisaggregatedLeadFollowInFormationController ( )
virtual

destructor

DtDisaggregatedLeadFollowInFormationController::DtDisaggregatedLeadFollowInFormationController ( )
private

default constructor - not implemented

DtDisaggregatedLeadFollowInFormationController::DtDisaggregatedLeadFollowInFormationController ( const DtDisaggregatedLeadFollowInFormationController orig)
private

copy constructor - not implemented

Member Function Documentation

virtual const char* DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::preFirstTickInit ( )
virtual

Init myProcessState->setMovingToRoute.

Reimplemented from DtSimComponent.

virtual void DtDisaggregatedLeadFollowInFormationController::tick ( )
virtual

Calls beginFollowInFormation when route is discovered. Calls processRouteChanged when haveVerticesChanged is true for myRoute.

Reimplemented from DtSimComponent.

virtual void DtDisaggregatedLeadFollowInFormationController::clearTask ( )
virtual

If tasked, clears out myProcessState, sends clear task messages to any subordinates that are currently tasked. Override to send clear task messages to subordinates and delete working routes, if currently tasked.

Reimplemented from DtSingleTaskControllerComponent.

virtual bool DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::currentTaskState ( ) const
virtual

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

Reimplemented from DtSingleTaskControllerComponent.

static void DtDisaggregatedLeadFollowInFormationController::moveAlongCallback ( DtSimMessage msg,
void *  usr,
DtSimTaskStatePtr  taskStatePtr 
)
static
static void DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::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 beginFollowInFormation with updated info.

Parameters
formationStateFormation state repository for the aggregate (maintained in aggregate state repository).
usrPointer to instance of this class.
static DtSimComponent* DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::processMoveAlong ( const DtTaskMessage msg,
DtSimTaskStatePtr  taskStatePtr 
)
protectedvirtual
virtual void DtDisaggregatedLeadFollowInFormationController::processFormationChanged ( const DtFormationState formationState)
protectedvirtual

Calls beginFollowInFormation.

Parameters
formationStateFormation state maintained in our aggregate's state repository.
virtual void DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::processRouteChanged ( )
protectedvirtual

Calls beginFollowInFormation.

Parameters
objThe route we're currently following.
virtual int DtDisaggregatedLeadFollowInFormationController::sendTaskToSubordinate ( const DtSimTask task,
const DtUUID subordinate 
)
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.
Returns
Task tracking number assigned to the task.
virtual void DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::beginFollowInFormation ( const DtUUID routeName,
const bool  startAtClosestPoint,
const bool  traverseForward 
)
protectedvirtual

Gets formation data from DtVrfAggregateStateRepository::formationState() Calls createLeaderOffsetRoute Sends subtasks lead-formation and follow-in-formation.

virtual int DtDisaggregatedLeadFollowInFormationController::findClosestSegmentIndex ( DtVector  testPoint,
std::vector< DtVector testRoute,
DtPoint closestSegmentLoc,
double distanceToSegment,
int  indexSegmentFloor = 0 
)
protectedvirtual

Find the segment in the given route that is closest to the given point.

Parameters
testPointThe given point to measure distance to.
testRouteA route defined by a vector of points.
closestSegmentLoc.Return value. The location (point) on the route that is closest to the test point.
distanceToSegment.Return value. The distance of the testPoint to closestSegmentLoc.
indexSegmentFloor.The segment index from which to start the search for the closest point.
Returns
A segment index. For a route with N vertices, the segment index will be in [0, N-2]. Calls closestPointAlongChord2D.
virtual bool DtDisaggregatedLeadFollowInFormationController::createLeaderOffsetRoute ( const std::vector< DtVector > &  localPoints,
const double  rightOffset,
const double  forwardOffset,
DtUUID routeUUID,
DtUUID   
)
protectedvirtual

Creates working offset route for the leader. Calls generateOffsetRoute.

Parameters
localPointsDtVectors of the main route
rightOffsetright-ward distance subroute should be from the main route
forwardOffsetforward distance subroute should be from the main route is the fraction of the way to the next vertex.
routeUUIDUUID of the main route
virtual bool DtDisaggregatedLeadFollowInFormationController::isPlatformCapable ( const DtUUID platform) const
protectedvirtual

Determines if the platform is able to move with the formation. Used to determine if a leader is capable or must be replaced.

virtual int DtDisaggregatedLeadFollowInFormationController::taskLeader ( const DtUUID leader,
const DtSimObjectReferenceList subs,
const DtUUID leaderRoute,
const double  formationWidth,
const double  formationLength 
)
protectedvirtual

Tasks the leader with a DtLeadFormationTaskType.

Returns
The task tracking number generated for this task.
virtual int DtDisaggregatedLeadFollowInFormationController::taskFollower ( const DtUUID subEntity,
const DtUUID formationLeader,
const DtUUID unitRouteUUID,
const double  leaderForwardOffset,
const bool  doReverseRoute,
const double  vertexStartIndex 
)
protectedvirtual

Tasks a subordinate with DtFollowInFormationTaskType.

Returns
The task tracking number generated for this task.
virtual void DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::initializeMemberDataFromDescriptor ( const DtAggregateMoveAlongDescriptor desc)
protectedvirtual
Parameters
descDescriptor used to configure this component.
virtual bool DtDisaggregatedLeadFollowInFormationController::isUnitMovementExhausted ( )
protectedvirtual

Check to see if the unit task should be ended because subordinate movement has ended. This is a fail safe, because normally the subordinates should finish their moves and send taskComplete reports that are processed to end the unit task. However, if the leader has finished its movement task and the subordinates are all stopped, but haven't sent task complete reports, then something is hanging them up. In that case this unit behavior can shut itself down and continue.

virtual void DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::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 double DtDisaggregatedLeadFollowInFormationController::dist2D ( const DtVector position1,
const DtVector position2,
const Coordinate_System coordinateSystem 
)
protectedvirtual
DtDisaggregatedLeadFollowInFormationController& DtDisaggregatedLeadFollowInFormationController::operator= ( const DtDisaggregatedLeadFollowInFormationController orig)
private

assignment operator - not implemented

Member Data Documentation

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

Map of formation positions to generated route object names.

std::map<const DtSimObject*, DtEntityRouteFollowingData> DtDisaggregatedLeadFollowInFormationController::myEntityRouteFollowingMap
protected

Map of subordinates and route following data.

std::map<const DtSimObject*, DtEntityRouteTraversalState> DtDisaggregatedLeadFollowInFormationController::myEntityRouteTraversalStateMap
protected

Map of subordinate and current route traversal state.

DtVrfAggregateStateRepository* DtDisaggregatedLeadFollowInFormationController::myAggregateStateRepository
protected

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

DtFormationState* DtDisaggregatedLeadFollowInFormationController::myFormationState
protected

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

DtCompatibilityRadio* DtDisaggregatedLeadFollowInFormationController::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 DtDisaggregatedLeadFollowInFormationController::myGenerateRoutesWithRoundedCorners
protected

Flag indicating all generated route should have rounded turns. Default is true.

double DtDisaggregatedLeadFollowInFormationController::myVertexSpacingAlongRoundedCorners
protected

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

DtAggregateMoveAlongPSR* DtDisaggregatedLeadFollowInFormationController::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* DtDisaggregatedLeadFollowInFormationController::myAggregateMoveAlongDescriptor
protected

Pointer to descriptor used to configure this object.

bool DtDisaggregatedLeadFollowInFormationController::myRegisteredFormationChangedCallback
protected

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

unsigned int DtDisaggregatedLeadFollowInFormationController::myNextRouteIndex
protected

Counter used in naming generated routes. Routes are assigned unique object names using the convention <original route="" name>="">_<myNextRouteIndex>.

DtSimTaskStatePtr DtDisaggregatedLeadFollowInFormationController::myCachedTaskState
protected
bool DtDisaggregatedLeadFollowInFormationController::mySetObjectToBeRemovedCallbacks
protected
DtSimObjectReference DtDisaggregatedLeadFollowInFormationController::myRoute
protected
bool DtDisaggregatedLeadFollowInFormationController::myRestartTaskOnFormationUpdate
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)