VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanMoveAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
18 
19 class DtCgf;
21 class DtSimMessage;
24 class DtVectorOutputPort;
25 class DtAnalogOutputPort;
26 
39 {
40 private:
47  const DtHumanMoveAlongController& orig);
48 public:
52  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
53  DtReaderWriterRegistry *parentRegistry=0);
54 
56  virtual ~DtHumanMoveAlongController();
57 
59  virtual bool init();
60 
63  virtual const char* type() const;
64 
69  virtual void preFirstTickInit();
70 
78  virtual void tick();
79 
80  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
81 
82  virtual DtSimTaskStatePtr currentTaskState() const;
83 
87  virtual void processRouteChanged(const DtSimObject* obj);
88 
90  virtual void registerTaskMsgCallbacks();
91 
99  virtual bool setupRoute(bool routeHasChanged, bool resetVertex);
100 
107  virtual bool setupDestination();
108 
114  virtual void stop();
115 
117  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner,
118  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
119  DtReaderWriterRegistry* parentRegistry=0);
120 
126  virtual bool createPSR();
127 
128 protected:
129  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
130 
132  static DtReaderWriter* provideNextRoutePointIndex(void* c);
133 
135  virtual DtHumanMoveAlongPSR* getPSR(){return myProcessState;}
136 
138  virtual void setDestination(const DtVector& localLocation);
139  virtual void createMoveToPoint(const DtVector& localLocation);
140 
142  virtual void sendMoveToSubtask();
143 
146  virtual void clearTask();
147 
151  virtual bool getCurrentRouteSegment(DtVector& routeSegmentStart,
152  DtVector& routeSegmentEnd) const;
153 
155  virtual void cleanupMoveToPoint();
156 
157  static void taskCompleteReportCallback(DtSimMessage* msg, void* usr);
158  virtual void processTaskCompleteReport(DtSimMessage* msg);
159 
160  virtual bool passedDestination();
161  virtual void setupDestinationVector();
162 
163  virtual bool atDestination() const;
164  virtual double distanceToDestination() const;
165 
166  virtual double atDistance() const;
167 
168  virtual bool createPorts();
169 
170  virtual void processEstimatedTotCalculation();
171 
172 protected:
173 
175 
179 
181 
184 
186 
189 
196 
203 
210 
212  const double DtEstimatedTotCalcInterval = 5.0;
213 
220 
226 };
227 
bool myEstimatedTotCalcEnabled
enabled flag for the tot calculations
Definition: humanMoveAlongController.h:215
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
double myRouteWaitTimeout
Definition: humanMoveAlongController.h:224
virtual DtHumanMoveAlongPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: humanMoveAlongController.h:135
Description: This repository holds all information that is common to all the forms of humans within t...
Definition: humanStateRepository.h:33
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
Definition: readerWriter.h:85
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
bool myOverrideSpeed
Definition: humanMoveAlongController.h:187
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtVector myWorldDestination
Definition: humanMoveAlongController.h:182
double myOverrideSpeedValue
Definition: humanMoveAlongController.h:188
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtHumanMoveAlongControllerDescriptor; descriptor for the DtHumanMoveAlongController component...
Definition: humanMoveAlongControllerDescriptor.h:18
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: humanMoveAlongController.h:225
bool myWaitingRoute
Definition: humanMoveAlongController.h:222
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
void registerDtHumanMoveAlongController(DtCgf *cgf)
Registers component and associated classes with the factories. Call after DtVrfApp::init() ...
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
double myMissingTimeStart
Definition: humanMoveAlongController.h:223
File: simMsg.h.
Definition: simMessage.h:35
DtVector myLocalDestination
Definition: humanMoveAlongController.h:183
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtHumanStateRepository * myHumanStateRepository
Definition: humanMoveAlongController.h:174
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: humanMoveAlongController.h:209
virtual DtSimTaskStatePtr currentTaskState() const
double myEstimatedTotValue
the tot value
Definition: humanMoveAlongController.h:217
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtAnalogOutputPort * myEtaForLastVertexOutputPort
Output Port Name: eta-for-last-vertex Output Port Description: Specifies the eta for the last vertex ...
Definition: humanMoveAlongController.h:202
double myEstimatedTotLastCalcTime
used for tot calculation intervals
Definition: humanMoveAlongController.h:219
DtHumanMoveAlongController is a controller that models movement along a route for an individual human...
Definition: humanMoveAlongController.h:38
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
class DtHumanMoveAlongPSR:
Definition: humanMoveAlongPSR.h:26
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtVectorOutputPort * myLastVertexLocationOutputPort
Output Port Name: last-vertex-location Output Port Description: Specifies the last vertex location of...
Definition: humanMoveAlongController.h:195
The top level class of a VR-Forces Simulation Engine, representing a Computer Generated Forces instan...
Definition: cgf.h:144
bool myWarnedOnce
Definition: humanMoveAlongController.h:221
DtHumanMoveAlongControllerDescriptor * myHumanMoveAlongControllerDescriptor
Definition: humanMoveAlongController.h:180
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
DtHumanMoveAlongPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: humanMoveAlongController.h:178
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
DtVector myDestinationVector
Definition: humanMoveAlongController.h:185

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)