VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtTargetSelectionController Class Reference

DtTargetSelectionController is a controller that takes the list know object contacts from the entity's state repository, and from this list of contacts, generates prioritized target lists for any number of weapons.

End User Description: This component receives lists of sensor contacts the entity state repository, and selects appropriate targets from those lists, which are then put out on target lists which can be used by weapon systems. The number of output target lists is variable, and depends on the number of target-output blocks specified in the descriptor. Each target output can have a different set of entity types it targets, as well as different coverage area in relation to the entity. This component also listens for setTarget messages from the GUI, and uses the specified target as highest priority target on the output list. Developer Description: The selectTargets() creates the prioritized target lists from this fused contact list.

Each weapon has its own target selection criteria, specified in the descriptor, which allows different priorities for different weapons.

Prioritizing of targets happens with the use of a DtTargetRankOperator, which defines a comparison operator between two contacts. This may be overridden and replaced with a user-defined ranking operator. By default, targets are ranked first based on the entity-type based target priority (specified in the descriptor), then based on whether they are in the current Sector of Responsibility, and finally on range from the host entity.

Any target specified in a setTarget message sent to this entity will be put as the highest priority target when it is on the input list for any weapon for which it is valid.

Note
This controller used to take a list of contacts from one or more sensors (VRF 3.10 and earlier), but was changed to read the list of known sensor contacts from the state repository. A controller such as the DtContactFusionController combines contacts from multiple sensors and populates the list in the state repository.

Uses Descriptor Type: DtComponentDescriptor

Inheritance diagram for DtTargetSelectionController:
Inheritance graph
[legend]

Public Types

typedef std::list
< DtWeaponComponentInterface * > 
DtWeaponInterfaceList
 
- 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 )()
 

Public Member Functions

 DtTargetSelectionController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtTargetSelectionController ()
 
virtual bool init ()
 
virtual const chartype () const
 
virtual void registerTaskMsgCallbacks ()
 
virtual void updateWeaponInterfaceTaskState (DtWeaponComponentInterface *weapIf)
 
virtual void updateTargetPriorityListState ()
 
virtual void taskComplete (bool success=true)
 
virtual bool postAddComponentsInit ()
 
virtual void preFirstTickInit ()
 
virtual void tick ()
 
- 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 clearTask ()
 
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 DtSimTaskStatePtr currentTaskState () 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 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 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 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 Types

typedef std::set
< DtRwSensorContactInfo
*, DtTargetRankOperatorWrapper
DtOrderedTargetSet
 
- 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
 

Protected Member Functions

virtual void processSimObjectAdded (DtSimObjectReference)
 
virtual bool createPorts ()
 
virtual bool createOutputPorts ()
 
virtual bool createPSR ()
 
virtual void registerRadioMessageCallbacks ()
 
virtual void processSetTarget (DtSimMessage *msg)
 
virtual void selectTargets ()
 
virtual bool targetForce (DtForceType force) const
 
virtual bool validTarget (const DtRwSensorContactInfo &contactInfo, const DtWeaponComponentInterface &weapIf) const
 
virtual DtEntityTargetInformation targetInfoFromContactInfo (const DtRwSensorContactInfo &contactInfo) const
 
virtual void updateRegionEvaluators ()
 
virtual DtTargetRankOperatorcreateTargetRankOperator (const DtTargetSelectionCriteria &criteria) const
 
virtual void setupDetectableForces (DtForceType)
 
virtual void clearTargets ()
 
virtual bool isSurrenderedLifeform (const DtSimObject *entity) const
 
virtual bool findFusedTargets (const std::map< DtUUID, DtRwSensorContactInfo * > &contactList, const DtWeaponComponentInterface &weapIf, DtRwSensorContactInfo &userTargetInfo, DtOrderedTargetSet &orderedTargets)
 
virtual const
DtRwSensorContactInfo
setTargetsToWeaponInterface (DtWeaponComponentInterface &weapIf, DtRwSensorContactInfo &userTargetInfo, DtOrderedTargetSet &orderedTargets)
 
virtual void findWeaponControlInterfaces ()
 
virtual bool permissionToFire () const
 
virtual bool canFireAtBasedOnTargetPriorityListRoe (const DtSimObject *entity) const
 
virtual bool suppressed () const
 
virtual bool allowedToFire () const
 
virtual bool haveCommonMount (DtWeaponComponentInterface *weapon1, DtWeaponComponentInterface *weapon2) const
 
virtual bool yieldsFiringPrecedenceTo (DtWeaponComponentInterface *weapon1, bool weapon1IsBeingTasked, DtWeaponComponentInterface *weapon2)
 
virtual bool tokenConflict (DtWeaponComponentInterface *weapon1, DtWeaponComponentInterface *weapon2)
 
virtual bool artPartConflict (DtWeaponComponentInterface *weapon1, DtWeaponComponentInterface *weapon2, DtArtPartType *conflictingPart)
 
virtual bool otherWeaponBlocksWeapon (DtWeaponComponentInterface *weapon, bool weaponIsBeingTasked, DtWeaponComponentInterface **conflictingWeapon, bool *controlExternalTurret)
 
virtual void clearLowerPriorityWeaponTargets (DtWeaponComponentInterface *weapon)
 
virtual void assembleListOfFiredUponTargets (std::set< DtUUID > &targets)
 
virtual int nextPriorityValue ()
 
virtual void setNextPriorityValue (const int val)
 
virtual const artPartWeaponMaparticulatedPartWeapons () const
 
virtual void addArtPartWeaponToMap (const DtArtPartType part, const DtWeaponComponentInterface *weaponInterface)
 
virtual void setArticulatedPartWeapons (const artPartWeaponMap &artPartMap)
 
- 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 ()
 
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)
 

Static Protected Member Functions

static void setTargetCallback (DtSimMessage *msg, void *usr)
 

Protected Attributes

DtObjectTypesListOutputPortmyTypesToDetectOutputPort
 
DtTargetSelectionControllerPSRmyProcessState
 
DtSensorContactInfoListChangeMonitor myContactListChangeMonitor
 
DtForceType myForce
 
bool mySetupDetectableForcesRequired
 
DtWeaponInterfaceList myWeaponInterfaceList
 
DtRwInt myNextPriorityValue
 
artPartWeaponMap myArticulatedPartWeapons
 
std::map
< DtWeaponComponentInterface
*, int
myOldInterfaceStatus
 
bool myHavePrintedSurrender
 
bool myHavePrintedNoNewContacts
 
boost::signals2::scoped_connection mySimObjectAddedConnection
 
- 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

 DtTargetSelectionController ()
 
 DtTargetSelectionController (const DtTargetSelectionController &orig)
 
DtTargetSelectionControlleroperator= (const DtTargetSelectionController &orig)
 
virtual void processFireAtTargetTask (DtSimMessage *msg)
 
virtual bool processFireAtTargetTask (DtFireAtTargetTask *, bool &foundValidWeapon)
 
static void fireAtTargetTaskCallback (DtSimMessage *msg, void *usr)
 
virtual void processWeaponListRequest (const DtVrfObjectMessage *msg)
 
static void weaponListRequestCallback (const DtVrfObjectMessage *msg, void *usr)
 
virtual void processFireNow (DtSimMessage *msg)
 
static void fireNowCallback (DtSimMessage *msg, void *usr)
 
virtual void processHostilitiesChanged (DtU8 force)
 
static void hostilitiesChangedCallback (DtU8 force, void *usr)
 

Additional Inherited Members

- 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
 

Member Typedef Documentation

Constructor & Destructor Documentation

DtTargetSelectionController::DtTargetSelectionController ( )
private

Not Implemented.

DtTargetSelectionController::DtTargetSelectionController ( const DtTargetSelectionController orig)
private

Not Implemented.

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

Destructor.

Member Function Documentation

DtTargetSelectionController& DtTargetSelectionController::operator= ( const DtTargetSelectionController orig)
private

Not Implemented.

virtual bool DtTargetSelectionController::init ( )
virtual

Init. Call immediately after construction.

Reimplemented from DtControllerComponent.

virtual const char* DtTargetSelectionController::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
DtTargetSelectionControllerType

Implements DtTaskControllerComponent.

virtual void DtTargetSelectionController::registerTaskMsgCallbacks ( )
virtual

Registers for DtFireAtTargetTask.

Reimplemented from DtTaskControllerComponent.

virtual void DtTargetSelectionController::updateWeaponInterfaceTaskState ( DtWeaponComponentInterface weapIf)
virtual

Updates task state for a weaponInterface. Checks for task completion and weapon status.

virtual void DtTargetSelectionController::updateTargetPriorityListState ( )
virtual

Updates state for the target priority list. Checks for entity destroyed or non-existence.

static void DtTargetSelectionController::fireAtTargetTaskCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes Fire at Target tasks. Selects a weapon according to the task settings, and assigns the target to the selected weapon. If no valid weapon systems are found, calls taskComplete(false).

virtual void DtTargetSelectionController::processFireAtTargetTask ( DtSimMessage msg)
virtual

Returns true if object exists. foundValidWeapon will be set to true if a valid weapon for the target is found.

virtual bool DtTargetSelectionController::processFireAtTargetTask ( DtFireAtTargetTask ,
bool foundValidWeapon 
)
virtual

Returns true if object exists. foundValidWeapon will be set to true if a valid weapon for the target is found.

static void DtTargetSelectionController::weaponListRequestCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
static

Responds to weapon list requests with list of weapon names associated with this entity.

virtual void DtTargetSelectionController::processWeaponListRequest ( const DtVrfObjectMessage msg)
virtual

Responds to weapon list requests with list of weapon names associated with this entity.

static void DtTargetSelectionController::fireNowCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes fire now by tasking itself a DtFireAtTarget task.

virtual void DtTargetSelectionController::processFireNow ( DtSimMessage msg)
virtual

Processes fire now by tasking itself a DtFireAtTarget task.

virtual void DtTargetSelectionController::taskComplete ( bool  success = true)
virtual

Clears the task state of weapon interfaces.

Reimplemented from DtSingleTaskControllerComponent.

virtual bool DtTargetSelectionController::postAddComponentsInit ( )
virtual

Finds all weapons available to this entity and enables the fire-at-target task if appropriate.

Reimplemented from DtControllerComponent.

virtual void DtTargetSelectionController::preFirstTickInit ( )
virtual

Clears the task state of weapon interfaces. If currentTaskMessage() has a task, calls processFireAtTask.

Reimplemented from DtSimComponent.

virtual void DtTargetSelectionController::tick ( )
virtual

This component's simulation tick.

Each tick thsi component: updates the task state of weapon interfaces; updates detectable forces if necessary; checks for contact list changes; updates region evaluators; and does autonomous target selection.

Reimplemented from DtSimComponent.

static DtSimComponent* DtTargetSelectionController::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 DtTargetSelectionController::processSimObjectAdded ( DtSimObjectReference  )
protectedvirtual

Called when object is added. Check to see if this is the object we are looking for in our task.

virtual bool DtTargetSelectionController::createPorts ( )
protectedvirtual

Creates and initializes ports.

Reimplemented from DtSimComponent.

virtual bool DtTargetSelectionController::createOutputPorts ( )
protectedvirtual

Creates a target list output port for each weapon entry in the descriptor. Ports are named based on the name in the descriptor.

virtual bool DtTargetSelectionController::createPSR ( )
protectedvirtual

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 void DtTargetSelectionController::registerRadioMessageCallbacks ( )
protectedvirtual

Registers for setTarget messages from the local entity's radio.

static void DtTargetSelectionController::setTargetCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected

Static callback function. Calls processSetTarget().

virtual void DtTargetSelectionController::processSetTarget ( DtSimMessage msg)
protectedvirtual

Sets the userTarget in the PSR to the target specified in the set target message.

virtual void DtTargetSelectionController::selectTargets ( )
protectedvirtual

Walks the fusedContactsList once for each weapon, and if validTarget() returns true for each, uses the targetRankOperator returned by createTargetRankOperator() to sort the targets into the target list for the weapon. If a contact is specified as the userTargetName in the PSR, it takes highest priority on the output list for any weapon for which it is valid. Also resets the userTargetName in the process state repository to "" if the target did not show up on the fused contacts list.

virtual bool DtTargetSelectionController::targetForce ( DtForceType  force) const
protectedvirtual
Returns
true if targeting of the specified force type is currently allowed.
virtual bool DtTargetSelectionController::validTarget ( const DtRwSensorContactInfo contactInfo,
const DtWeaponComponentInterface weapIf 
) const
protectedvirtual
Returns
true if this contact is a valid target for the specified target selection criteria. Calls targetForce() to check if the force type of the contact is acceptable.
virtual DtEntityTargetInformation DtTargetSelectionController::targetInfoFromContactInfo ( const DtRwSensorContactInfo contactInfo) const
protectedvirtual
Returns
an entity target information structure based on the sensor contact info passed in.
virtual void DtTargetSelectionController::updateRegionEvaluators ( )
protectedvirtual

Updates all spatial filter evaluators with the current entity position and orientation.

virtual DtTargetRankOperator* DtTargetSelectionController::createTargetRankOperator ( const DtTargetSelectionCriteria criteria) const
protectedvirtual

Creates a new DtTargetRankOperator with the specified criteria and the host VrfObject of this component.

Returns
a DtPrioritySorRangeTargetRankOperator (this implementation does)
virtual void DtTargetSelectionController::setupDetectableForces ( DtForceType  )
protectedvirtual

Sets up detectable forces based on current force type. Sets myForce to force that was passed in.

static void DtTargetSelectionController::hostilitiesChangedCallback ( DtU8  force,
void *  usr 
)
staticprotected

Callback invoked by the hostility manager when the hostility matrix is changed.

virtual void DtTargetSelectionController::processHostilitiesChanged ( DtU8  force)
protectedvirtual

Callback invoked by the hostility manager when the hostility matrix is changed.

virtual void DtTargetSelectionController::clearTargets ( )
protectedvirtual

Clear the target lists.

virtual bool DtTargetSelectionController::isSurrenderedLifeform ( const DtSimObject entity) const
protectedvirtual

Check for surrendered lifeform state.

virtual bool DtTargetSelectionController::findFusedTargets ( const std::map< DtUUID, DtRwSensorContactInfo * > &  contactList,
const DtWeaponComponentInterface weapIf,
DtRwSensorContactInfo userTargetInfo,
DtOrderedTargetSet orderedTargets 
)
protectedvirtual
virtual const DtRwSensorContactInfo* DtTargetSelectionController::setTargetsToWeaponInterface ( DtWeaponComponentInterface weapIf,
DtRwSensorContactInfo userTargetInfo,
DtOrderedTargetSet orderedTargets 
)
protectedvirtual

Updates the weapon interface with a new target, either from the user target or the ordered target list. Returns the weapons next target, or null if there is none.

virtual void DtTargetSelectionController::findWeaponControlInterfaces ( )
protectedvirtual

Find any available weapon control interfaces on the entity and set them to the local list. Sort the list by weapon priority (a parameter in the gun controller descriptor) so that a higher priority weapon will get its choice of target before a lower priority weapon.

virtual bool DtTargetSelectionController::permissionToFire ( ) const
protectedvirtual

Checks the state repository's engagement rules to see if the entity has permission to fire. By default, ROE = fire-at-will, or fire-when-fired-upon and entity is under-fire.

virtual bool DtTargetSelectionController::canFireAtBasedOnTargetPriorityListRoe ( const DtSimObject entity) const
protectedvirtual

Returns true if this entity can fire upon the target entity given the rules of engagement.

virtual bool DtTargetSelectionController::suppressed ( ) const
protectedvirtual

Checks to see if the entity is suppressed.

virtual bool DtTargetSelectionController::allowedToFire ( ) const
protectedvirtual

Checks to see if conditions permit the entity to fire. By default, this is permissionToFire. Note that suppression is not tested here; it is treated on a per-weapon basis; e.g. a tank MG that requires a crew member to be exposed while firing might be suppressed by small arms fire, while the main gun is is not suppressed.

virtual bool DtTargetSelectionController::haveCommonMount ( DtWeaponComponentInterface weapon1,
DtWeaponComponentInterface weapon2 
) const
protectedvirtual

Checks to see if the two weapons are mounted, directly or indirectly, on a common articulated part. Uses the articulated part lists of the weapons. Returns true if they are mounted on a common part.

virtual int DtTargetSelectionController::nextPriorityValue ( )
protectedvirtual

Gets the next priority value (myNextPriorityValue) to use. Each time it is called, myNextPriorityValue increments by one.

virtual void DtTargetSelectionController::setNextPriorityValue ( const int  val)
protectedvirtual

Not normally used:

virtual const artPartWeaponMap& DtTargetSelectionController::articulatedPartWeapons ( ) const
protectedvirtual

Accessors for the map of articulated parts to lists of weapons that are attached to the part.

virtual void DtTargetSelectionController::addArtPartWeaponToMap ( const DtArtPartType  part,
const DtWeaponComponentInterface weaponInterface 
)
protectedvirtual

Accessors for the map of articulated parts to lists of weapons that are attached to the part.

virtual void DtTargetSelectionController::setArticulatedPartWeapons ( const artPartWeaponMap artPartMap)
protectedvirtual

Accessors for the map of articulated parts to lists of weapons that are attached to the part.

virtual bool DtTargetSelectionController::yieldsFiringPrecedenceTo ( DtWeaponComponentInterface weapon1,
bool  weapon1IsBeingTasked,
DtWeaponComponentInterface weapon2 
)
protectedvirtual

Determines if weapon1 should yield to the weapon2, assuming they conflict (i.e. if they use the same token resource or the same turret). This decision depends on the weapon priority (a parameter in the ballistic-gun-controller descriptor) and whether the weapon has been explicitly tasked. Lower priority numbers mean higher priority. A weapon is tasked if it was explicitly tasked with a fire-at-target task, or if the target selection controller gave it a target but the parameter treat-selected-target-as-tasked is set true in the ballistic-gun-controller descriptor.

If one weapon is tasked and the other isn't, then the tasked weapon takes control (i.e., this function returns true if weapon1 is not tasked and weapon2 is). If neither weapon is tasked or both are tasked, then weapon1 yields if weapon2's priority is strictly lower than weapon1's priority.

virtual bool DtTargetSelectionController::tokenConflict ( DtWeaponComponentInterface weapon1,
DtWeaponComponentInterface weapon2 
)
protectedvirtual

Determine if any of the token resources of weapon1 overlap with those of weapon2. A token is a word in the string parameter required-tokens in the ballistic-gun-controller descriptor. They are intended to represent entity resources needed to operate the weapon, such as crew members.

virtual bool DtTargetSelectionController::artPartConflict ( DtWeaponComponentInterface weapon1,
DtWeaponComponentInterface weapon2,
DtArtPartType *  conflictingPart 
)
protectedvirtual

Determine if any of the ancestor parts of weapon1's gun overlap with the ancestor parts of weapon2's gun.

Parameters
conflictingArtPartreturns the part number of the part that conflicted (valid if the function returns true).
virtual bool DtTargetSelectionController::otherWeaponBlocksWeapon ( DtWeaponComponentInterface weapon,
bool  weaponIsBeingTasked,
DtWeaponComponentInterface **  conflictingWeapon,
bool controlExternalTurret 
)
protectedvirtual

Determines if any other weapon in this controller's weapon interface list blocks the given weapon, i.e. it uses a common turret or token resource, and the given yields precedence to the other weapon. The other weapon must have a target to block the given weapon.

Parameters
weaponIsBeingTaskedshould be set true if the given weapon is being considered for a fire-at-target task, and false if it is auto-selecting a target. Tasked targets are given priority over auto-selected targets (except, see treat-selected-as-tasked parameter in the ballistic gun controller).
conflictingWeaponReturns a pointer to the (first) weapon found that blocks the given weapon.
controlExternalTurretIf the function returns false, i.e. the weapon is free to fire, this parameter may indicate that it should not try to control azimuth rotation outside of its own system. E.g., an MG mounted on a main gun turret can use its own ring, but shouldn't set outputs for the main gun turret. This is because a higher priority gun is controlling the external turret.
virtual void DtTargetSelectionController::clearLowerPriorityWeaponTargets ( DtWeaponComponentInterface weapon)
protectedvirtual

Goes through the weapon interface list, finds weapons that conflict with the given weapon (either on a common turret, or a token resource), and clears the other weapons' targets and tasks.
The procedure assumes that none of the other weapons block the given weapon (if one did, the weapon wouldn't fire, and it wouldn't be necessary to clear any other weapons).

Parameters
weaponThe weapon that is now firing.
virtual void DtTargetSelectionController::assembleListOfFiredUponTargets ( std::set< DtUUID > &  targets)
protectedvirtual

Assembles a list of targets that have already been fired upon. No need to target these again until we know the result of the attack.

Member Data Documentation

DtObjectTypesListOutputPort* DtTargetSelectionController::myTypesToDetectOutputPort
protected

Port I/O Interface:

Inputs: DtSensorContactListInputPort : detected-objects Outputs: DtObjectTypesListOutputPort : target-types-to-detect Output Port Name: target-types-to-detect
Output Port Description: List of types of object the target selection controller is interested in. Connects to the sensors.
Output Port Range:
Output Port Default Value:
Output Group Parent:

DtTargetSelectionControllerPSR* DtTargetSelectionController::myProcessState
protected

Container for state data associated with this component. This state is saved and restored as part of a scenario (or checkpoint).

DtSensorContactInfoListChangeMonitor DtTargetSelectionController::myContactListChangeMonitor
protected
DtForceType DtTargetSelectionController::myForce
protected

Force used to put information onto port for hostility matrix.

bool DtTargetSelectionController::mySetupDetectableForcesRequired
protected

Flag set to true if a re-run of the setupDetectableForces() is required on the next tick. (This is required when the hostility matrix changes)

DtWeaponInterfaceList DtTargetSelectionController::myWeaponInterfaceList
protected

List of weapon interfaces through which the target selection controller communicates with weapon systems. Sorted in order of descending weapon priority (priority for a gun is a parameter in the gun controller descriptor).

DtRwInt DtTargetSelectionController::myNextPriorityValue
protected

The next default priority level to use for a weapon. Starts at 1 and increments each time it is used.

artPartWeaponMap DtTargetSelectionController::myArticulatedPartWeapons
protected

A map of articulated part numbers to lists of weapons that are attached to the part directly or indirectly. For example, a tank turret would map to a list that includes the main gun and any MGs mounted on the turret. This map is used to identify interacting weapons. The map is constructed when the target selection controller is initialized, so this member is not saved in the scenario.

std::map<DtWeaponComponentInterface*, int> DtTargetSelectionController::myOldInterfaceStatus
protected

A record of the status of each weapon interface (last tick). If the status changes, it will make the controller re-select targets for the weapon interfaces.

bool DtTargetSelectionController::myHavePrintedSurrender
protected

For debugging print statements.

bool DtTargetSelectionController::myHavePrintedNoNewContacts
protected
boost::signals2::scoped_connection DtTargetSelectionController::mySimObjectAddedConnection
protected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)