VR-Forces 4.0.4 Class Documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtDisaggregatedMoveToLocationController Class Reference

DtAggregateMoveToLocationController is a task controller responsible for executing DtMoveToLocationTasks. More...

Inheritance diagram for DtDisaggregatedMoveToLocationController:
Inheritance graph
[legend]

List of all members.

Public Types

enum  DtSubtaskImplementation { DtImplementAsMoveIntoFormation = 0, DtImplementAsMoveAlongRoute }
typedef enum
DtDisaggregatedMoveToLocationController::DtSubtaskImplementation 
DtSubtaskImplementation

Public Member Functions

 DtDisaggregatedMoveToLocationController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtDisaggregatedMoveToLocationController ()
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Override to create process state repository. Calls createPSR().
virtual void clearTask ()
 Override to destroy working route, if route exists.

Static Public Member Functions

static void moveToLocationTaskCallback (DtSimMessage *msg, void *usr)
 Callback function for handling incoming turn to move to task message.
static void taskCompleteReportCallback (DtSimMessage *msg, void *usr)
 Calls onMoveToTask to process the message.
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual void registerTaskMsgCallbacks ()
 Registers task and set data request callbacks for following type: DtMoveToLocationTaskType.
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.
virtual void onMoveToLocationTask (DtSimMessage *msg)
 Unpacks incoming DtMoveToLocationTask, places data from the task on the appropriate output port in myMoveToControlPorts, sends the data in the output ports, and calls startTask().
virtual void onTaskComplete (DtSimMessage *msg)
 If tasked() is true and report is for a DtMoveIntoFormationTask type, calls taskComplete().
DtSubtaskImplementation chooseSubtaskImplementation (const DtVector &geocDestination) const
 Choose subtasking implementation.
virtual void moveIntoFormation (const DtVector &geocDestination)
 Move into formation at the given geocentric location, with our aggregate's current formation, and at the heading going from our current location to desired final location.
void moveAlongRoute (const DtVector &geocDestination)
 Move along route to the given geocentric destination.
virtual bool calcRouteStartingPoint (const DtVector &geocEndPoint, DtVector &geocStartPoint) const
 Calculate the starting point of a 2-point route that goes from current aggregate position to the given destination.
virtual DtString generateWorkingRouteName () const
 Generates a working route name to be used when implementing movement as a move-along subtask.
virtual bool publishFormationRoutes () const

Protected Attributes

DtVrfAggregateStateRepositorymyAggregateStateRepository
 Pointer to aggregate's state repository, cached in this class for convenience.
DtAggregateMoveToLocationPSRmyProcessState
 Container for state data associated with this component.
bool myToggleGeneratedName
 Flag used to toggle between 2 generated route names (<object name>="">_L1 and <object name>="">_L2).

Private Member Functions

 DtDisaggregatedMoveToLocationController (const DtDisaggregatedMoveToLocationController &orig)
 not implemented
DtDisaggregatedMoveToLocationControlleroperator= (const DtDisaggregatedMoveToLocationController &orig)
 not implemented

Detailed Description

DtAggregateMoveToLocationController is a task controller responsible for executing DtMoveToLocationTasks.

End User Description: DtAggregateMoveToLocationController models an aggregate's move-to-location behavior. The behavior is implemented by creating a working route that goes from the aggregate's current position to the target location. The controller then issues a subtask to itself to move along the route. The move-along behavior is carried out by the DtAggregateMoveAlongController. When the subtask is complete, this controller considers the move-to-location task complete.

This controller may only be configured as a part of an entity that has a vrf-aggregate-state-repository.

Uses Descriptor Type: DtComponentDescriptor


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
DtImplementAsMoveIntoFormation 
DtImplementAsMoveAlongRoute 

Constructor & Destructor Documentation

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

not implemented


Member Function Documentation

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:
DtAggregateMoveToLocationControllerType

Implements DtTaskControllerComponent.

Override to create process state repository. Calls createPSR().

Reimplemented from DtControllerComponent.

Override to destroy working route, if route exists.

Reimplemented from DtSingleTaskControllerComponent.

Callback function for handling incoming turn to move to task message.

Calls onMoveToLocationTask to actually handle the message.

Calls onMoveToTask to process the message.

Parameters:
msgMessage containing a DtTaskCompleteReport.
static DtSimComponent* DtDisaggregatedMoveToLocationController::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.

Registers task and set data request callbacks for following type: DtMoveToLocationTaskType.

Reimplemented from DtTaskControllerComponent.

virtual bool DtDisaggregatedMoveToLocationController::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.

Unpacks incoming DtMoveToLocationTask, places data from the task on the appropriate output port in myMoveToControlPorts, sends the data in the output ports, and calls startTask().

virtual void DtDisaggregatedMoveToLocationController::onTaskComplete ( DtSimMessage msg) [protected, virtual]

If tasked() is true and report is for a DtMoveIntoFormationTask type, calls taskComplete().

Parameters:
msgMessage containing a DtTaskCompleteReport.

Choose subtasking implementation.

If destination is too close to current aggregate position, returns DtImplementAsMoveIntoFormation (there isn't enough space for aggregate to move to destination in formation). ' Otherwise returns DtImplementAsMoveAlongRoute (there is enough space for aggregate to be able to move to destination in formation).

Parameters:
geocDestinationDestination in geocentric coordinates.
Returns:
Enumeration indicating how behavior should be implemented.
virtual void DtDisaggregatedMoveToLocationController::moveIntoFormation ( const DtVector geocDestination) [protected, virtual]

Move into formation at the given geocentric location, with our aggregate's current formation, and at the heading going from our current location to desired final location.

Issues a DtMoveIntoFormationTask to ourself as a subtask.

Parameters:
geocDestinationLocation aggregate should move to, in geocentric coordinates.
void DtDisaggregatedMoveToLocationController::moveAlongRoute ( const DtVector geocDestination) [protected]

Move along route to the given geocentric destination.

Creates a working route going to the desired location. Issues a DtMoveAlongTask to ourself as a subtask.

Parameters:
geocDestinationLocation aggregate should move to, in geocentric coordinates.
virtual bool DtDisaggregatedMoveToLocationController::calcRouteStartingPoint ( const DtVector geocEndPoint,
DtVector geocStartPoint 
) const [protected, virtual]

Calculate the starting point of a 2-point route that goes from current aggregate position to the given destination.

Starting point is such that no member of the aggregate should have to move away from the destination to get into formation at the starting position.

Parameters:
geocEndPointLocation of route endpoint.
geocStartPointStarting point for route calculated in this function, in geocentric coordinates.

Generates a working route name to be used when implementing movement as a move-along subtask.

Returns:
Look up whether or not we should publish formation following routes in DtVrfSettingsManager. Returns true if setting cannot be found.
DtDisaggregatedMoveToLocationController& DtDisaggregatedMoveToLocationController::operator= ( const DtDisaggregatedMoveToLocationController orig) [private]

not implemented


Member Data Documentation

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

Container for state data associated with this component.

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

Flag used to toggle between 2 generated route names (<object name>="">_L1 and <object name>="">_L2).

Needed so we don't try to destroy and recreate the same object name in one tick.


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)