VR-Forces 4.0.4 Class Documentation
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. More...

Inheritance diagram for DtTargetSelectionController:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::list
< DtWeaponComponentInterface * > 
DtWeaponInterfaceList

Public Member Functions

 DtTargetSelectionController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtTargetSelectionController ()
 Destructor.
virtual bool init ()
 Init. Call immediately after construction.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void registerTaskMsgCallbacks ()
 Registers for DtFireAtTargetTask.
virtual void updateWeaponInterfaceTaskState (DtWeaponComponentInterface *weapIf)
 Updates task state for a weaponInterface.
virtual void taskComplete (bool success=true)
 Clears the task state of weapon interfaces.
virtual void tick ()
 This component's simulation tick.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Types

typedef std::set
< DtRwSensorContactInfo
*, DtTargetRankOperatorWrapper
DtOrderedTargetSet

Protected Member Functions

virtual bool createPorts ()
 Creates and initializes ports.
virtual bool createOutputPorts ()
 Creates a target list output port for each weapon entry in the descriptor.
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.
virtual void registerRadioMessageCallbacks ()
 Registers for setTarget messages from the local entity's radio.
virtual void processSetTarget (DtSimMessage *msg)
 Sets the userTarget in the PSR to the target specified in the set target message.
virtual void selectTargets ()
 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.
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 ()
 Updates all spatial filter evaluators with the current entity position and orientation.
virtual DtTargetRankOperatorcreateTargetRankOperator (const DtTargetSelectionCriteria &criteria) const
 Creates a new DtTargetRankOperator with the specified criteria and the host VrfObject of this component.
virtual void setupDetectableForces (DtForceType)
 Sets up detectable forces based on current force type.
virtual void clearTargets ()
 Clear the target lists.
virtual bool isSurrenderedLifeform (const DtVrfObject *entity) const
 Check for surrendered lifeform state.
virtual bool findFusedTargets (const DtSensorContactInfoList *contactList, const DtWeaponComponentInterface &weapIf, DtRwSensorContactInfo *userTargetInfo, DtOrderedTargetSet &orderedTargets)
virtual void setTargetsToWeaponInterface (DtWeaponComponentInterface &weapIf, DtRwSensorContactInfo *userTargetInfo, DtOrderedTargetSet &orderedTargets)
virtual void findWeaponControlInterfaces ()
 Find any available weapon control interfaces on the entity and set them to the local list.
virtual bool permissionToFire ()
 Checks the state repository's engagement rules to see if the entity has permission to fire.

Static Protected Member Functions

static void setTargetCallback (DtSimMessage *msg, void *usr)
 Static callback function. Calls processSetTarget().

Protected Attributes

DtObjectTypesListOutputPortmyTypesToDetectOutputPort
 Port I/O Interface:
DtTargetSelectionControllerPSRmyProcessState
 Container for state data associated with this component.
DtSensorContactInfoListChangeMonitor myContactListChangeMonitor
DtForceType myForce
 Force used to put information onto port for hostility matrix.
bool mySetupDetectableForcesRequired
 Flag set to true if a re-run of the setupDetectableForces() is required on the next tick.
bool myFirstTick
DtWeaponInterfaceList myWeaponInterfaceList
 List of weapon interfaces through which the target selection controller communicates with weapon systems.

Private Member Functions

 DtTargetSelectionController ()
 Not Implemented.
 DtTargetSelectionController (const DtTargetSelectionController &orig)
 Not Implemented.
DtTargetSelectionControlleroperator= (const DtTargetSelectionController &orig)
 Not Implemented.
virtual void processFireAtTargetTask (DtSimMessage *msg)
 Processes Fire at Target tasks.
static void fireAtTargetTaskCallback (DtSimMessage *msg, void *usr)
 Processes Fire at Target tasks.
virtual void processWeaponListRequest (const DtVrfObjectMessage *msg)
 Responds to weapon list requests with list of weapon names associated with this entity.
static void weaponListRequestCallback (const DtVrfObjectMessage *msg, void *usr)
 Responds to weapon list requests with list of weapon names associated with this entity.
virtual void processFireNow (DtSimMessage *msg)
 Processes fire now by tasking itself a DtFireAtTarget task.
static void fireNowCallback (DtSimMessage *msg, void *usr)
 Processes fire now by tasking itself a DtFireAtTarget task.
virtual void processHostilitiesChanged (DtU8 force)
 Callback invoked by the hostility manager when the hostility matrix is changed.
static void hostilitiesChangedCallback (DtU8 force, void *usr)
 Callback invoked by the hostility manager when the hostility matrix is changed.

Detailed Description

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


Member Typedef Documentation


Constructor & Destructor Documentation

Not Implemented.

Not Implemented.

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

(const DtString&,DtVrfObject*,DtSimManager*,

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

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 DtString 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.

Returns:
DtTargetSelectionControllerType

Implements DtTaskControllerComponent.

Registers for DtFireAtTargetTask.

Reimplemented from DtTaskControllerComponent.

Updates task state for a weaponInterface.

Checks for task completion and weapon status.

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).

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).

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

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

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 void DtTargetSelectionController::tick ( ) [virtual]

This component's simulation tick.

During the first tick, finds and caches all weapon interfaces for host entity and sets up detectable forces.

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,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
) [static]

(const DtString&,DtVrfObject*,DtSimManager*,

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

Returns:
New instance of this class.
virtual bool DtTargetSelectionController::createPorts ( ) [protected, virtual]

Creates and initializes ports.

Reimplemented from DtSimComponent.

virtual bool DtTargetSelectionController::createOutputPorts ( ) [protected, virtual]

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 ( ) [protected, 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 void DtTargetSelectionController::registerRadioMessageCallbacks ( ) [protected, virtual]

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

static void DtTargetSelectionController::setTargetCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]

Static callback function. Calls processSetTarget().

virtual void DtTargetSelectionController::processSetTarget ( DtSimMessage msg) [protected, virtual]

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

virtual void DtTargetSelectionController::selectTargets ( ) [protected, virtual]

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 [protected, virtual]
Returns:
true if targeting of the specified force type is currently allowed.
virtual bool DtTargetSelectionController::validTarget ( const DtRwSensorContactInfo contactInfo,
const DtWeaponComponentInterface weapIf 
) const [protected, virtual]
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.
Returns:
an entity target information structure based on the sensor contact info passed in.
virtual void DtTargetSelectionController::updateRegionEvaluators ( ) [protected, virtual]

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

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  ) [protected, virtual]

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 
) [static, protected]

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

virtual void DtTargetSelectionController::processHostilitiesChanged ( DtU8  force) [protected, virtual]

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

virtual void DtTargetSelectionController::clearTargets ( ) [protected, virtual]

Clear the target lists.

virtual bool DtTargetSelectionController::isSurrenderedLifeform ( const DtVrfObject entity) const [protected, virtual]

Check for surrendered lifeform state.

virtual bool DtTargetSelectionController::findFusedTargets ( const DtSensorContactInfoList contactList,
const DtWeaponComponentInterface weapIf,
DtRwSensorContactInfo userTargetInfo,
DtOrderedTargetSet orderedTargets 
) [protected, virtual]
virtual void DtTargetSelectionController::setTargetsToWeaponInterface ( DtWeaponComponentInterface weapIf,
DtRwSensorContactInfo userTargetInfo,
DtOrderedTargetSet orderedTargets 
) [protected, virtual]
virtual void DtTargetSelectionController::findWeaponControlInterfaces ( ) [protected, virtual]

Find any available weapon control interfaces on the entity and set them to the local list.

virtual bool DtTargetSelectionController::permissionToFire ( ) [protected, virtual]

Checks the state repository's engagement rules to see if the entity has permission to fire.


Member Data Documentation

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:

Container for state data associated with this component.

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

DtForceType DtTargetSelectionController::myForce [protected]

Force used to put information onto port for hostility matrix.

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)

List of weapon interfaces through which the target selection controller communicates with weapon systems.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)