![]() |
VR-Forces 4.0.4 Class Documentation
|
DtAggregateMoveToLocationController is a task controller responsible for executing DtMoveToLocationTasks. More...

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 DtSimComponent * | creator (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 | |
| DtVrfAggregateStateRepository * | myAggregateStateRepository |
| Pointer to aggregate's state repository, cached in this class for convenience. | |
| DtAggregateMoveToLocationPSR * | myProcessState |
| 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 | |
| DtDisaggregatedMoveToLocationController & | operator= (const DtDisaggregatedMoveToLocationController &orig) |
| not implemented | |
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
| typedef enum DtDisaggregatedMoveToLocationController::DtSubtaskImplementation DtDisaggregatedMoveToLocationController::DtSubtaskImplementation |
| DtDisaggregatedMoveToLocationController::DtDisaggregatedMoveToLocationController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtDisaggregatedMoveToLocationController::~DtDisaggregatedMoveToLocationController | ( | ) | [virtual] |
| DtDisaggregatedMoveToLocationController::DtDisaggregatedMoveToLocationController | ( | const DtDisaggregatedMoveToLocationController & | orig | ) | [private] |
not implemented
| virtual DtString DtDisaggregatedMoveToLocationController::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.
Implements DtTaskControllerComponent.
| virtual bool DtDisaggregatedMoveToLocationController::init | ( | ) | [virtual] |
Override to create process state repository. Calls createPSR().
Reimplemented from DtControllerComponent.
| virtual void DtDisaggregatedMoveToLocationController::clearTask | ( | ) | [virtual] |
Override to destroy working route, if route exists.
Reimplemented from DtSingleTaskControllerComponent.
| static void DtDisaggregatedMoveToLocationController::moveToLocationTaskCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callback function for handling incoming turn to move to task message.
Calls onMoveToLocationTask to actually handle the message.
| static void DtDisaggregatedMoveToLocationController::taskCompleteReportCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Calls onMoveToTask to process the message.
| msg | Message 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*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual void DtDisaggregatedMoveToLocationController::registerTaskMsgCallbacks | ( | ) | [protected, virtual] |
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.
| virtual void DtDisaggregatedMoveToLocationController::onMoveToLocationTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
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().
| msg | Message containing a DtTaskCompleteReport. |
| DtSubtaskImplementation DtDisaggregatedMoveToLocationController::chooseSubtaskImplementation | ( | const DtVector & | geocDestination | ) | const [protected] |
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).
| geocDestination | Destination in geocentric coordinates. |
| 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.
| geocDestination | Location 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.
| geocDestination | Location 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.
| geocEndPoint | Location of route endpoint. |
| geocStartPoint | Starting point for route calculated in this function, in geocentric coordinates. |
| virtual DtString DtDisaggregatedMoveToLocationController::generateWorkingRouteName | ( | ) | const [protected, virtual] |
Generates a working route name to be used when implementing movement as a move-along subtask.
| virtual bool DtDisaggregatedMoveToLocationController::publishFormationRoutes | ( | ) | const [protected, virtual] |
| DtDisaggregatedMoveToLocationController& DtDisaggregatedMoveToLocationController::operator= | ( | const DtDisaggregatedMoveToLocationController & | orig | ) | [private] |
not implemented
DtVrfAggregateStateRepository* DtDisaggregatedMoveToLocationController::myAggregateStateRepository [protected] |
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).
bool DtDisaggregatedMoveToLocationController::myToggleGeneratedName [mutable, protected] |
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.